RQST - Auto reboot / exit maintenance mode after long disk check

Terrahawk

Member
I occasionally see a disk reallocated sector count increase warning displayed by the web interface and typically perform a long fixdisk check overnight when noticed.
If I thereafter forget to exit maintenance mode next morning, my box misses the scheduled recordings.

I'd like my HDR Fox T2 to automatically exit maintenance mode and reboot at the end of a long disk check.
I'm inexperienced with Linux and looking for advise of the best way to achieve this.

I run the disk check via the telnet "fixdisk" menu option with -l -y options.

I see there's a file "/var/lib/humaxtv_backup/mod/tmenu" containing the telnet menu script
Can the reboot script under the exit maintenance mode section simply be inserted under the fix-disk command as shown below?

Code:
mmode_opt()
{
    case $model:$1 in
        HDR:fixdisk)
        echo -n "Any additional options "
        echo -n "(-h for list or press return for none): "
        read fxopts
        fxmsg="run the hard disk checker"
        [ -n "$fxopts" ] && fxmsg="$fxmsg ($fxopts)?" || \
            fxmsg="$fxmsg?"
        if [ "$fxopts" = "-h" ] || ays "$fxmsg"; then
            session_start fix-disk /bin/fix-disk $fxopts
           
            #Can reboot command be inserted here??
            #Below from the exit maintenance mode section
           
           
            feedback RESTARTING wait
            echo -n "Restarting..."
            /bin/sync
            # Try and unmount all disks. Run in the background
            # so that it doesn't matter if it hangs due to a
            # disk problem.
            umount_all &
            dots 5
            reboot
           
           
        else
            echo "Cancelled."
        fi
        ;;

Web interface version: 1.5.1-5
Custom firmware version: 3.13 (build 4028)
Humax Version: 1.02.32 (kernel HDR_CFW_3.13)
Loader Version: a7.30
 
Last edited:
Back
Top