Reboot from terminal?



  • How do I reboot my phone from the terminal, without having to type the password? I have a cron-job running to check connectivity, and I would like the script to able to boot the phone under certain circumstances. I tried adding: Cmnd_Alias SHUTDOWN_CMDS = /sbin/poweroff, /sbin/shutdown, /sbin/reboot & phablet ALL=(ALL) NOPASSWD: SHUTDOWN_CMDS with visudo after remounting / as rw, but it still prompts me. Any ideas?

    Regards

    Grisen



  • In my terminal, "sudo reboot" works. Does "reboot" or "sudo reboot" work in your cron job?



  • Well "sudo reboot" works, but it prompts me for the password. I tried adding the job to sudo's crontab, but that doesn't work. The solution I described in post 1 works on a desktop ubuntu. After doing what I described, "sudo reboot" reboots the machine without prompting for password.

    Regards

    Grisen


Log in to reply
 

Looks like your connection to UBports Forum was lost, please wait while we try to reconnect.