Linux - shutdown-script with SSH -


i make shutdown-script raspberry pi shut down anothe raspberry pi on ssh.

the script works if running @ shutdown routine ssh command not executed.

so have done until now:

  1. made script in /etc/init.d:
 #!/bin/sh  # first thing test if shutdown script working  echo "bla bla bla " | sudo tee -a /test.txt    ssh pi@10.0.0.98 sudo shutdown -h 
  1. made executable
sudo chmod +x /etc/init.d/raspi.sh 
  1. made symlink rc0.d
sudo ln -s /etc/init.d/raspi.sh /etc/rc0.d/s01raspi.sh 

now know far shutdown script working outside of shutdown routing calling , shutdown symlink made working partially because see changes in test.txt file every time shut down.

can me how solve problem?

have tried single quotes? first link in google has it

http://malcontentcomics.com/systemsboy/2006/07/send-remote-commands-via-ssh.html

what sudo, how solve entering password?

https://superuser.com/questions/117870/ssh-execute-sudo-command

please check or other links on web have useful information.

i have send in comment cant yet because of reputation.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -