diff options
author | Deepti Kulkarni <deepti@vyatta.com> | 2010-07-02 20:45:27 +0000 |
---|---|---|
committer | Deepti Kulkarni <deepti@vyatta.com> | 2010-07-02 20:45:27 +0000 |
commit | 26a96076ce8a7fe98aa43d81b11258d8dc6c990f (patch) | |
tree | 9e8efa047c8981809f12e575be66a800358f9a24 /scripts/system | |
parent | 4a43e9c91fa4e760837ce4a58e40a6654291afa0 (diff) | |
download | vyatta-cfg-quagga-26a96076ce8a7fe98aa43d81b11258d8dc6c990f.tar.gz vyatta-cfg-quagga-26a96076ce8a7fe98aa43d81b11258d8dc6c990f.zip |
Corrected the fix for bug 5408.
Diffstat (limited to 'scripts/system')
-rwxr-xr-x | scripts/system/vyatta_update_telnet | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/scripts/system/vyatta_update_telnet b/scripts/system/vyatta_update_telnet index 1a1f5f70..07d6946f 100755 --- a/scripts/system/vyatta_update_telnet +++ b/scripts/system/vyatta_update_telnet @@ -3,18 +3,14 @@ # and block changes when logged in over telnet # Block changes to telnet daemon when logged in over telnet -parent_proc_id=`ps -fp $$ | tail -1 | awk '{print $3}'` -while [ "$parent_proc_id" != "1" ] -do - proc_id=$parent_proc_id - parent_proc_id=`ps -fp $proc_id | tail -1 | awk '{print $3}'` -done - - if ps $proc_id | grep -q telnetd - then - echo "Please configure telnet settings via ssh or console" - exit 1 - fi +pid=$(who -um | awk -F " " '{print $7}') +if [ -n "$pid" ]; then + if ps --pid $(ps --pid $pid -o ppid=) -o cmd= | grep -q telnetd + then + echo "Please configure telnet settings via ssh or console." + exit 1 + fi +fi usage() { echo "Usage: $0 enable <port>" |