Skip to content

Instantly share code, notes, and snippets.

@ojacques
Created October 1, 2017 12:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ojacques/520056a8d03e5fe8d48d7426c4e3154f to your computer and use it in GitHub Desktop.
Save ojacques/520056a8d03e5fe8d48d7426c4e3154f to your computer and use it in GitHub Desktop.
Redémarrage LABOX SFR
export labox_IP="192.168.0.1"
export labox_user="admin"
export labox_password="password"
export labox_urlcheck="http://url__a_verifier_avec_port_redir:port"
#!/bin/bash -x
# -------------------------------
# LA BOX SFR
# Vérifie que la redirection de ports fonctionne
# et redémarrage du modem dans le cas contraire
# -------------------------------
# Configuration
source .env
# Vérification
wget -q "${labox_urlcheck}" -O /dev/null
if [ $? -ne 0 ]; then
logger Reboot de la Box pour cause de redirection de port inopérante
# Connection a l'interface
wget -q -P /dev/null --post-data="loginUsername=${labox_user}&loginPassword=${labox_password}" --no-check-certificate --delete-after https://${labox_IP}/goform/login
sleep 2
# Appel de la page pour reboot
wget -q -P /dev/null --tries=1 --header="Origin:https://${labox_IP}" --header="Referer: https://${labox_IP}/config.html" --post-data "" --no-check-certificate https://${labox_IP}/goform/WebUiOnlyReboot
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment