15

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?

grg
  • 113
  • 6
Viswa
  • 191
  • 1
  • 2
  • 6
  • Wouldn't it be faster to just restart your video player, instead of rebooting the whole Pi? – Arne Jun 13 '13 at 09:36
  • I need to restart two raspberry pi from my ubuntu system(via shell script).@Arne – Viswa Jun 13 '13 at 10:39

2 Answers2

19

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.

lenik
  • 11,541
  • 1
  • 30
  • 37
  • 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 07: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 07: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 08:28
  • 2
    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 08:33
  • Does "sudo shutdown" and "Sudo halt" do the same thing ? – user3378649 Feb 19 '15 at 06: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.

Don Cesar D'Bazar
  • 511
  • 1
  • 4
  • 4
  • 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 08:29
  • Run the command twice ? Or write a script to run it for both IP addresses – Lawrence Jun 14 '13 at 03:11