diff options
Diffstat (limited to 'qmenu/qmenu_vm/fqvm_service')
-rw-r--r-- | qmenu/qmenu_vm/fqvm_service | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/qmenu/qmenu_vm/fqvm_service b/qmenu/qmenu_vm/fqvm_service new file mode 100644 index 0000000..cc8baaa --- /dev/null +++ b/qmenu/qmenu_vm/fqvm_service @@ -0,0 +1,39 @@ +services=1 + +while [ -n "$services" ]; do + + services=$(qvm-service "$qube" --list | dmenu-unlinked -l 32 -p "$qube:" | cut -f1 -d\ ) + + if [ -n "$services" ]; then + + for service in $services; do + + qvm-service "$qube" --list | grep -q "^$service " && + + unset='\nUnset' + + value=$(printf "Disable\nEnable$unset" | dmenu-unlinked -l 3 -i -p "Select value for '$service':") + + if [ "$value" = Disable ]; then + + qvm-service "$qube" "$service" off || + + echo Go back... | dmenu-unlinked -p "Error: Failed to deactivate '$service'!" > /dev/null 2>&1 + + elif [ "$value" = Enable ]; then + + qvm-service "$qube" "$service" on || + + echo Go back... | dmenu-unlinked -p "Error: Failed to activate '$service'!" > /dev/null 2>&1 + + elif [ "$value" = Unset ]; then + + qvm-service "$qube" "$service" --unset || + + echo Go back... | dmenu-unlinked -p "Error: Failed to unset '$service'!" > /dev/null 2>&1 + fi + + [ -n "$unset" ] && unset unset + done + fi +done |