I’ve got an HS3Pi working at a remote location, so startup/shutdown/reboot etc is automated. Every night the Pi shuts down via cron, the power is switched off using a mechanical timer and then on again a few minutes later causing HS3 to restart. Thus if the Pi crashes completely there’s a good chance it will come on again the next day.
However, it seems from experience so far that HS3 is not 100% happy about not being shutdown gracefully before the Pi shuts down. So that’s what I’m trying to achieve. But because HS3 is running as a screen session my limited Linux abilities are not enough to get the correct syntax.
my startup line in rc.local is
screen -d -m ./usr/share/scripts/startup.sh
and startup.sh invokes the ‘go’ command. This all works fine.
When I shut HS3 down manually I type
sudo screen -r (there’s only one screen session working, so nothing else is needed)
shutdown
then press enter.
So those are the lines I’m trying to recreate in a script so I can run them as an HS3 event. Please would someone be kind enough to point me in the right direction? The ‘screen’ operators and ‘stuff’ commands are proving a little hard to get my head round! Thanks!
However, it seems from experience so far that HS3 is not 100% happy about not being shutdown gracefully before the Pi shuts down. So that’s what I’m trying to achieve. But because HS3 is running as a screen session my limited Linux abilities are not enough to get the correct syntax.
my startup line in rc.local is
screen -d -m ./usr/share/scripts/startup.sh
and startup.sh invokes the ‘go’ command. This all works fine.
When I shut HS3 down manually I type
sudo screen -r (there’s only one screen session working, so nothing else is needed)
shutdown
then press enter.
So those are the lines I’m trying to recreate in a script so I can run them as an HS3 event. Please would someone be kind enough to point me in the right direction? The ‘screen’ operators and ‘stuff’ commands are proving a little hard to get my head round! Thanks!
Comment