summaryrefslogtreecommitdiff
path: root/templates/service/telnet/allow-root/node.def
blob: 9c3ff97d45ba56a4cb8f4fa23c51d5ba0e4a9177 (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
type: bool
default: false
help: "Enable/disable root login"
update: " \
  if ! env | grep -q SSH_TTY=; then \
    if [[ \"`tty`\" == /dev/pts/* ]]; then \
      echo \"Please configure telnet settings via ssh or console.\"; \
      exit 1; \
    fi; \
  fi; \
  if [ \"$(@)\" == \"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: " \
  if ! env | grep -q SSH_TTY=; then \
    if [[ \"`tty`\" == /dev/pts/* ]]; then \
      echo \"Please configure telnet settings via ssh or console.\"; \
      exit 1; \
    fi; \
  fi; \
  sudo mv -f /etc/securetty.allow-root /etc/securetty >&/dev/null ; \
  /bin/true"