Skip to content

Instantly share code, notes, and snippets.

@thosmos
Created August 6, 2024 02:14
Show Gist options
  • Save thosmos/900cecd7248882c0fb669a802a0ea752 to your computer and use it in GitHub Desktop.
Save thosmos/900cecd7248882c0fb669a802a0ea752 to your computer and use it in GitHub Desktop.
Althea router reset button behavior
#!/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment