type: txt

help: Ctrl-Alt-Delete action

default: "ignore"

val_help: ignore; Ignore Ctrl-Alt-Delete
val_help: reboot; Reboot VyOS
val_help: poweroff; Poweroff VyOS

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

end:
  if [ $VAR(@) == "ignore" ]; then
    sudo sh -c "ln -sf /dev/null \
      /lib/systemd/system/ctrl-alt-del.target"
  elif [ $VAR(@) == "reboot" ]; then
    sudo sh -c "ln -sf /lib/systemd/system/reboot.target \
      /lib/systemd/system/ctrl-alt-del.target"
  elif [ $VAR(@) == "poweroff" ]; then
    sudo sh -c "ln -sf /lib/systemd/system/poweroff.target \
      /lib/systemd/system/ctrl-alt-del.target"
  fi

  # Reload systemd daemon for change to take effect
  sudo /bin/systemctl daemon-reload
