Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify reset button behavior #87

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions firmware-root/etc/rc.button/reset
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/sh

. /lib/functions.sh

OVERLAY="$( grep ' /overlay ' /proc/mounts )"

case "$ACTION" in
timeout)
. /etc/diag.sh
set_state failsafe
;;
released)
if [ "$SEEN" -lt 1 ]
then
echo "REBOOT" > /dev/console
sync
reboot
elif [ "$SEEN" -ge 5 -a -n "$OVERLAY" ]
then
echo "ROUTER RESET" > /dev/console
rm /overlay/upper/etc/config/wireless
/etc/init.d/rita stop
sed -i 's/rita_dashboard_password.*//g' /etc/rita.toml
sync
reboot
fi
;;
esac

return 0
Loading