13

I have mounted my Raspberry Pi videos folder into my Ubuntu 10.04 system. I can paste different videos to mounted directory along with videos folder in Raspberry Pi whenever I require.

The problem is I want to restart the Raspberry Pi every time manually to play newly pasted content in the videos folder. So, I decided that I want to reboot the Raspberry Pi by writing the script and run it on my local system.

Is there a command available to restart the Raspberry Pi through my local system?

| improve this question | | | | |
  • Wouldn't it be faster to just restart your video player, instead of rebooting the whole Pi? – Arne Jun 13 '13 at 9:36
  • I need to restart two raspberry pi from my ubuntu system(via shell script).@Arne – Viswa Jun 13 '13 at 10:39
15

something like this might help:

$ ssh pi@192.168.1.XXX 'echo raspberry | sudo shutdown -r now'

this command connects to your raspberry using SSH and issues the reboot command, make sure you replace 192.168.1.XXX with the real address and pi/raspberry with your real login/password.

| improve this answer | | | | |
  • dude,i run this command in my terminal "ssh root@192.168.1.106 'echo openelec | shutdown -r now'" then it prompts password, i was typed and it throws "sh:shutdown:command not found" – Viswa Jun 13 '13 at 7:49
  • try to specify the full path to the shutdown command, you may find if using which shutdown while logged to your pi. – lenik Jun 13 '13 at 7:52
  • ssh root@192.168.1.106 reboot this command is working, if i suppose to reboot two raspberry pi at a time means how to do – Viswa Jun 13 '13 at 8:28
  • 1
    ssh root@192.168.1.106 reboot; ssh root@192.168.1.107 reboot ? put several commands in line, separate with ";" and specify correct IP addresses. – lenik Jun 13 '13 at 8:33
  • Does "sudo shutdown" and "Sudo halt" do the same thing ? – user3378649 Feb 19 '15 at 6:19
0

Also note that user name prefixed by @ can vary from vendor of your OS, for example Arch Linux : root (and you do not need sudo) Debian : pi (you need sudo) Pidora : any name you chosen at setup (and you need sudo plus password)

I setup a user in Pidora with same name as I use at Ubuntu, so I do not need to specify any @ prefix.

| improve this answer | | | | |
  • Through this command "ssh root@192.168.1.106 reboot" i can reboot my raspberry, but i need to reboot morethan one raspberry pi at time. How to do – Viswa Jun 13 '13 at 8:29
  • Run the command twice ? Or write a script to run it for both IP addresses – Lawrence Jun 14 '13 at 3:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.