selection=$(dialog --backtitle"$BACKTITLE"--title"$TITLE"--clear--cancel-label"Exit to shell"--menu"Please select:"$LISTLENGHT 70 15\
selection=$(dialog --backtitle"$BACKTITLE"--title"$TITLE"--clear--cancel-label"Exit to shell"--menu"Please select:"$LISTLENGHT 70 $BOXLENGHT\
"${LIST[@]}" 2>&1 1>&3)
exit_status=$?
exec 3>&-
...
...
@@ -201,6 +202,19 @@ DIALOG_ESC=255
h3disp
exit
;;
"Desktop")
if[[-f /usr/sbin/nodm &&-n$(service nodm status | grep-w active | grep-w running)]];then
dialog --title"Desktop is enabled and running"--backtitle"$BACKTITLE"--yes-label"Stop"--no-label"Cancel"--yesno"\nDo you want to stop and disable this service?" 7 50
exitstatus=$?;
[[$exitstatus= 0 ]]&& service nodm stop &&sed-i"s/^NODM_ENABLED=.*/NODM_ENABLED=false/" /etc/default/nodm
else
dialog --title"Desktop is disabled"--backtitle"$BACKTITLE"--yes-label"Start"--no-label"Cancel"--yesno"\nDo you want to enable and start this service?" 7 50
exitstatus=$?;
[[$exitstatus= 0 ]]&&sed-i"s/^NODM_ENABLED=.*/NODM_ENABLED=true/" /etc/default/nodm && service nodm start