diff options
Diffstat (limited to 'scripts/system')
-rwxr-xr-x | scripts/system/vyatta_update_telnet | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/scripts/system/vyatta_update_telnet b/scripts/system/vyatta_update_telnet index 0725a85f..69afae35 100755 --- a/scripts/system/vyatta_update_telnet +++ b/scripts/system/vyatta_update_telnet @@ -3,13 +3,27 @@ # 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 +#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>" echo " $0 disable" |