diff options
author | Deepti Kulkarni <deepti@vyatta.com> | 2010-07-01 05:26:51 +0000 |
---|---|---|
committer | Deepti Kulkarni <deepti@vyatta.com> | 2010-07-01 05:26:51 +0000 |
commit | 5bdda1a1cb6b28f183c94b182bae523f5b74565f (patch) | |
tree | c34a7cd213456d87dfbbd91922018895bfde0a01 /scripts/system/vyatta_update_telnet | |
parent | c9cb1873ad4cec5a4c4a9cbdec3eca86068a65cf (diff) | |
download | vyatta-cfg-system-5bdda1a1cb6b28f183c94b182bae523f5b74565f.tar.gz vyatta-cfg-system-5bdda1a1cb6b28f183c94b182bae523f5b74565f.zip |
fix for bug 5408.
Diffstat (limited to 'scripts/system/vyatta_update_telnet')
-rwxr-xr-x | scripts/system/vyatta_update_telnet | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/scripts/system/vyatta_update_telnet b/scripts/system/vyatta_update_telnet index 0725a85f..1a1f5f70 100755 --- a/scripts/system/vyatta_update_telnet +++ b/scripts/system/vyatta_update_telnet @@ -3,12 +3,18 @@ # and block changes when logged in over telnet # Block changes to telnet daemon when logged in over telnet -pid=$(who -um | awk -F " " '{print $7}') -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 +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 usage() { echo "Usage: $0 enable <port>" |