#!/bin/sh
export DATE="22.12.2005";SCRIPT=${0#/rom}
export TITLE="Administration :
Redémarrage"
. ${SCRIPT%/*}/cgi-bin-pre.sh
cat<Administration :
Redémarrage
EOF
if [ "$REQUEST_METHOD" = "POST" ]; then
read QUERY_STRING
fi
if [ -z "$QUERY_STRING" ]; then
ff_firmware=
if ! grep -q ff_reset /rom/etc/preinit /etc/preinit>/dev/null 2>&1; then
ff_firmware='" DISABLED="DISABLED'
fi
cat<
EOF
if [ "$(nvram get boot_wait)" != "on" ]; then
cat<Veuillez
Noter : Le paramètre de configuration boot_wait
possède la valeur de "$(nvram get boot_wait)". Pour
laisser la possibilité de charger un nouveau firmware via TFTP, la
procédure de redémarrage va changer la valeur à "on".
EOF
fi
if [ -n "$ff_firmware" ]; then
cat<Attention :
Les différentes options de redémarrage ne fonctionne qu'avec
le firmware Freifunk seulement.
EOF
fi
else
eval $(echo "$QUERY_STRING"|awk -F'&' '{for(i=1;i<=NF;i++){print $i}}')
DIRTY=
if [ -n "$post_reset" ]; then
if [ "$ff_reset" = "killnvram" ]; then
if [ $(cat /proc/mtd|awk '/^mtd3:/{print $4}') = '"nvram"' ]; then
mtd erase /dev/mtd/3
fi
else
for V in ff_reset boot_wait; do
eval "C=\$$V"
C=$(unescape $C)
if [ "$C" != "$(nvram get $V)" ]; then
DIRTY=1
nvram set $V="$C"
fi
done
test -n "$DIRTY" && nvram commit>/dev/null 2>&1
fi
cat<L'AP
est en train de redémarrer. Patientez SVP... |
EOF
if [ "$ff_reset" = "failsafe" ]; then
cat<
Astuce :
En mode failsafe, l'adresse IP du point d'accès est toujours
192.168.1.1
. Pendant que vous attendez que l'AP se rallume,
la carte réseau peut être reconfigurer avec une adresse
appropriée par exemple : 192.168.1.2
.
EOF
elif [ "$ff_reset" = "format" ] || [ "$ff_reset" = "killnvram" ]; then
cat<
EOF
else
cat<
EOF
fi
sh -c "sleep 2;reboot">/dev/null 2>&1 &
fi
fi
. ${SCRIPT%/*}/cgi-bin-post.sh