Skip to content

Instantly share code, notes, and snippets.

@devversion
Last active June 16, 2024 08:57
Show Gist options
  • Save devversion/2a613562a2adbf89ff6f60fa8c76482a to your computer and use it in GitHub Desktop.
Save devversion/2a613562a2adbf89ff6f60fa8c76482a to your computer and use it in GitHub Desktop.
Toggle Wifi of Unifi standalone AP using SSH
mode=$1 # enabled or disabled
sshpass -p <PW> ssh -o StrictHostKeyChecking=no admin@<ip> <<EOF
sed -i "s/wireless.status=.*/wireless.status=$mode/" /tmp/system.cfg
cfgmtd -f /tmp/system.cfg -w
reboot now
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment