tui-scripts/s

15 lines
434 B
Plaintext
Raw Normal View History

2024-03-16 15:34:40 +00:00
#!/bin/bash
set -e
cat > /tmp/.dialogrc << EOL
# Item color
tag_color = (BLACK,WHITE,ON)
EOL
service=$(systemctl list-units --type service --all --plain --quiet | awk '{ print $1 }' | fzf)
set +ex
action=$(DIALOGRC=/tmp/.dialogrc dialog --stdout --erase-on-exit --menu "Choose the action for $service" 10 40 0 "Status" 1 "Start" 2 "Stop" 3 "Disable" 4 "Enable" 5)
if [ ! -z $action ]; then
sudo systemctl ${action,,} $service
fi