summaryrefslogtreecommitdiff
path: root/templates/service/telnet/allow-root/node.def
blob: b853fc42e767beca498f1ed28a9b058c85d6bda5 (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
30
31
32
33
34
35
36
37
38
39
40
type: bool
default: false
help: Enable/disable root login

update: 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 [ "$VAR(@)" == "true" ]
        then 
          sudo mv -f /etc/securetty /etc/securetty.allow-root >&/dev/null
        else
          sudo mv -f /etc/securetty.allow-root /etc/securetty >&/dev/null
        fi 
        /bin/true

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 mv -f /etc/securetty.allow-root /etc/securetty >&/dev/null
        /bin/true

comp_help: possible completions:
  true     Enable root login over telnet
  false    Disable root login over telnet

allowed: echo "true false"