summaryrefslogtreecommitdiff
path: root/templates/service/telnet/node.def
blob: 399f25ac82f6fe3a3618f46d40c6ffea700fc78e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
help: Enable/disable Network Virtual Terminal Protocol (TELNET) protocol

delete: pids=`who -u | awk -F " " '{print $7}'`
        for i in $pids
        do
          ppid=`ps -p $i -o ppid=`
          if ps -p $ppid -o cmd= | grep -q telnetd
          then
            echo "Please configure telnet settings via ssh or console."
            exit 1
          fi
        done
        sudo /opt/vyatta/sbin/telnetd.init stop

end:    pids=`who -u | awk -F " " '{print $7}'`
        for i in $pids
        do
          ppid=`ps -p $i -o ppid=`
          if ps -p $ppid -o cmd= | grep -q telnetd
          then
            echo "Please configure telnet settings via ssh or console."
            exit 1
          fi
        done
        if [ -z "$VAR(port/@)" ] 
        then
          exit 0
        fi
        sudo /opt/vyatta/sbin/telnetd.init restart $VAR(port/@)