#!/usr/bin/webif-page >|max=10|$FORM_submit string|FORM_periodic_restart_submit|@TR<>|max=10|$FORM_periodic_restart_submit EOF if [ "$?" != "0" ] then FORM_submit="" FORM_periodic_restart_submit="" fi if empty "$FORM_periodic_restart_submit"; then config_load restart get_default periodic_restart_enable restart enable get_default periodic_restart_hour restart hour get_default periodic_restart_day restart day get_default periodic_restart_month restart month get_default periodic_restart_weekday restart weekday if [ `grep "/bin/restartfonera" /etc/crontabs/root | wc -l` -eq 1 ]; then FORM_periodic_restart_hour="`grep "/bin/restartfonera" /etc/crontabs/root | awk '{print $2}'`" FORM_periodic_restart_day="`grep "/bin/restartfonera" /etc/crontabs/root | awk '{print $3}'`" FORM_periodic_restart_month="`grep "/bin/restartfonera" /etc/crontabs/root | awk '{print $4}'`" FORM_periodic_restart_weekday="`grep "/bin/restartfonera" /etc/crontabs/root | awk '{print $5}'`" fi else validate <> @TR<>||$FORM_periodic_restart_enable EOF equal "$?" "0" && { save_setting restart restart enable "$FORM_periodic_restart_enable" if [ "$FORM_periodic_restart_enable" = "1" ] ; then validate <> @TR<>||$FORM_periodic_restart_hour cronval|FORM_periodic_restart_day|@TR<> @TR<>||$FORM_periodic_restart_day cronval|FORM_periodic_restart_month|@TR<> @TR<>||$FORM_periodic_restart_month cronval|FORM_periodic_restart_weekday|@TR<> @TR<>||$FORM_periodic_restart_weekday EOF equal "$?" 0 && { save_setting restart restart hour "$FORM_periodic_restart_hour" save_setting restart restart day "$FORM_periodic_restart_day" save_setting restart restart month "$FORM_periodic_restart_month" save_setting restart restart weekday "$FORM_periodic_restart_weekday" # write line to crontab grep -v "/bin/restartfonera" /etc/crontabs/root >/tmp/crontab_tmp echo '0'\ ' '${FORM_periodic_restart_hour}\ ' '${FORM_periodic_restart_day}\ ' '${FORM_periodic_restart_month}\ ' '${FORM_periodic_restart_weekday}\ ' /bin/restartfonera' >>/tmp/crontab_tmp mv /tmp/crontab_tmp /etc/crontabs/root } else grep -v "/bin/restartfonera" /etc/crontabs/root >/tmp/crontab_tmp mv /tmp/crontab_tmp /etc/crontabs/root fi commit_settings SAVED=1 } fi header "Reboot" cat < EOF if empty "$FORM_periodic_restart_submit"; then if empty "$FORM_submit"; then ASAVED=0 else case "$FORM_reboot" in "") echo "

@TR<>!" ;; "PPP") echo "

RESTARTING PPPoE/PPTP-Connection" echo "

@TR<>..." ;; "Services") echo "

RESTARTING SERVICES" echo "

@TR<>..." ;; "LaFonera") echo "

REBOOTING" echo "

@TR<>..." ;; esac fi fi display_form <>. end_row end_table start_table|0|10|5 EOF [ "$mode" = "pppoe" ] || [ "$mode" = "pptp" ] && { display_form <> add_radio_cell|reboot||PPP end_row EOF } display_form <> add_radio_cell|reboot||Services end_row add_row add_label_cell|@TR<> add_radio_cell|reboot||LaFonera end_row end_table start_table|0|10|5 add_row add_button_cell|submit|@TR<>|tableTextButton end_row end_table infotable|Advanced_periodic_restart#Here you can adjust periodic restart of your Fonera. start_table|0|10|5 add_row add_label_cell|@TR<> start_select_cell|periodic_restart_enable|$FORM_periodic_restart_enable|tableTextSelect|modechange option|0|@TR<> option|1|@TR<> end_select_cell end_row end_table start_div|periodicrestart start_table|0|10|5 add_row add_label_cell|@TR<