Thread
:
ssh-status AKA "SSH Status and Switcher"
View Single Post
rasmarc
2015-04-13 , 21:06
Posts: 136 | Thanked: 263 times | Joined on Nov 2012 @ Germany
#
29
I got v 0.19 working properly by making some changes to /usr/sbin/ssh-status.sh.
There was no problem with hildon-status-menu. It was just blocked as soon as the start/stop commands were executed. I discovered this by doing "killall sshd" from a terminal when the status menu was blocked.
So I added an ampersand '&' to the commands "start sshd" and "stop sshd" remembering a hint from peterleinchen in
another thread
. After that the status menu worked as usual. But two things didn't work reliable: starting ssh and detecting if ssh was running.
When starting ssh didn't work i executed "start sshd &" from a terminal which gave either "ssh respawning too fast" or "process terminated with status 255". After using "/etc/init.d/ssh start" instead of "start sshd &" and adding a "sleep 1" it kept working.
And detecting status of ssh using "status sshd" resp. "status sshd | grep -c running" sometimes gave "0" although ssh was running. As an alternative i found "ps aux | grep -c /usr/sbin/sshd" working reliable.
Additionally i replaced "stop sshd &" with "killall sshd", because i don't need connections kept alive when stopping ssh. And finally i changed the messages confirming start/stop from being dialogs disappearing only if pressed to "infoprints" at the top of the screen disappearing automatically. I copied the relevant code from ade's cooktimer.
Attached Files
ssh-status.sh.tar.gz
(1.1 KB, 58 views)
Quote & Reply
|
The Following User Says Thank You to rasmarc For This Useful Post:
handaxe
rasmarc
View Public Profile
Send a private message to rasmarc
Find all posts by rasmarc