type: txt

help: Ctrl-Alt-Delete action

default: "disable"

val_help: disable; Disable Ctrl-Alt-Delete
val_help: reboot; Reboot VyOS
val_help: poweroff; Poweroff VyOS

syntax:expression: $VAR(@) in "disable", "reboot", "poweroff"; "Value must be disable, reboot, or poweroff"

end:
  if [ $VAR(@) == "disable" ]; then
    sudo sh -c "sed -i -e 's/^ca.*/ca:12345:ctrlaltdel:/' \
      /etc/inittab"
  elif [ $VAR(@) == "reboot" ]; then
    sudo sh -c "sed -i -e 's/^ca.*/ca:12345:ctrlaltdel:\/sbin\/reboot/' \
      /etc/inittab"
  elif [ $VAR(@) == "poweroff" ]; then
    sudo sh -c "sed -i -e 's/^ca.*/ca:12345:ctrlaltdel:\/sbin\/shutdown -h now/' \
      /etc/inittab"
  fi

  # Reload /etc/inittab for change to take effect
  sudo /sbin/init q
