Config : Systemd menu

This commit is contained in:
MatMoul 2018-09-16 03:16:25 +02:00
parent 1fcd6346c4
commit 2d002dc61e

View file

@ -5,9 +5,9 @@ options=()
options+=("Enable" "") options+=("Enable" "")
options+=("Disable" "") options+=("Disable" "")
options+=("" "") options+=("" "")
options+=("Restart" "") options+=("Restart" "(Experimental)")
options+=("Start" "") options+=("Start" "(Experimental)")
options+=("Stop" "") options+=("Stop" "(Experimental)")
defaultitem="Enable" defaultitem="Enable"
sel=$(whiptail --backtitle "$apptitle" --title "Systemd services Menu :" --menu "" --default-item "$defaultitem" --cancel-button "Back" 0 0 0 \ sel=$(whiptail --backtitle "$apptitle" --title "Systemd services Menu :" --menu "" --default-item "$defaultitem" --cancel-button "Back" 0 0 0 \
@ -57,10 +57,9 @@ case $sel in
services=$(systemctl | grep running) services=$(systemctl | grep running)
svclist=() svclist=()
for itm in $services; do for itm in $services; do
for lbl in $itm; do if [[ $itm = *"."* ]]; then
svclist+=("$itm" "" off) svclist+=("$itm" "" off)
break fi
done
done done
sel=$(whiptail --backtitle "$apptitle" --title "Restart services :" --checklist "" --cancel-button "Cancel" 0 0 0 \ sel=$(whiptail --backtitle "$apptitle" --title "Restart services :" --checklist "" --cancel-button "Cancel" 0 0 0 \
"${svclist[@]}" \ "${svclist[@]}" \
@ -75,10 +74,9 @@ case $sel in
services=$(systemctl | grep exited) services=$(systemctl | grep exited)
svclist=() svclist=()
for itm in $services; do for itm in $services; do
for lbl in $itm; do if [[ $itm = *"."* ]]; then
svclist+=("$itm" "" off) svclist+=("$itm" "" off)
break fi
done
done done
sel=$(whiptail --backtitle "$apptitle" --title "Start services :" --checklist "" --cancel-button "Cancel" 0 0 0 \ sel=$(whiptail --backtitle "$apptitle" --title "Start services :" --checklist "" --cancel-button "Cancel" 0 0 0 \
"${svclist[@]}" \ "${svclist[@]}" \
@ -93,10 +91,9 @@ case $sel in
services=$(systemctl | grep running) services=$(systemctl | grep running)
svclist=() svclist=()
for itm in $services; do for itm in $services; do
for lbl in $itm; do if [[ $itm = *"."* ]]; then
svclist+=("$itm" "" off) svclist+=("$itm" "" off)
break fi
done
done done
sel=$(whiptail --backtitle "$apptitle" --title "Stop services :" --checklist "" --cancel-button "Cancel" 0 0 0 \ sel=$(whiptail --backtitle "$apptitle" --title "Stop services :" --checklist "" --cancel-button "Cancel" 0 0 0 \
"${svclist[@]}" \ "${svclist[@]}" \