1#!/bin/sh
2
3failsafe_wait() {
4    FAILSAFE=
5    grep -q 'SES: UP FLIP' /proc/adm8668/buttons && FAILSAFE=true && export FAILSAFE
6    grep -q 'SES: DOWN' /proc/adm8668/buttons && FAILSAFE=true && export FAILSAFE
7    if [ "$FAILSAFE" != "true" ]; then
8        preinit_net_echo "Please press button now to enter failsafe"
9        fs_wait_for_key f 'to enter failsafe mode' $fs_failsafe_wait_timeout && FAILSAFE=true && export FAILSAFE
10    fi
11}
12