aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/adm8668/base-files/lib/preinit/45_failsafe_adm8668
blob: c54aaed1ea45754400ccb0578cd86beb5e6b4eda (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/sh

failsafe_wait() {
    FAILSAFE=
    grep -q 'SES: UP FLIP' /proc/adm8668/buttons && FAILSAFE=true && export FAILSAFE
    grep -q 'SES: DOWN' /proc/adm8668/buttons && FAILSAFE=true && export FAILSAFE
    if [ "$FAILSAFE" != "true" ]; then
        preinit_net_echo "Please press button now to enter failsafe"
        fs_wait_for_key f 'to enter failsafe mode' $fs_failsafe_wait_timeout && FAILSAFE=true && export FAILSAFE
    fi
}