Improve autostart-manage script
This commit is contained in:
parent
e45acae5b4
commit
cf6ef78b67
4 changed files with 24 additions and 6 deletions
|
@ -18,13 +18,14 @@ _list () {
|
|||
}
|
||||
|
||||
_echo_table () {
|
||||
printf "Unit\tFilename\tStatus\n"
|
||||
printf "Unit\tFilename\tEnabled\tActive\n"
|
||||
for unit in "$@"
|
||||
do
|
||||
printf "%s\t%s\t%s\n" \
|
||||
printf "%s\t%s\t%s\t%s\n" \
|
||||
"$unit" \
|
||||
"$(_filename "$unit")" \
|
||||
"$(_systemctl "$unit" is-enabled)"
|
||||
"$(_systemctl "$unit" is-enabled)" \
|
||||
"$(_systemctl "$unit" is-active)"
|
||||
done
|
||||
}
|
||||
|
||||
|
@ -79,7 +80,10 @@ case $1 in
|
|||
edit) _systemctl "$2" edit --full ;;
|
||||
enable) _systemctl "$2" add-wants autostart.target ;;
|
||||
disable) _systemctl "$2" disable ;;
|
||||
restart) _systemctl "${2:-*}" restart;;
|
||||
start) _systemctl "${2:-*}" start;;
|
||||
status) _systemctl "${2:-*}" status ;;
|
||||
start) systemctl --user start autostart.target ;;
|
||||
stop) _systemctl "${2:-*}" stop ;;
|
||||
run) systemctl --user start autostart.target ;;
|
||||
*) echo "'$1' is not valid" ;;
|
||||
esac
|
||||
|
|
|
@ -6,5 +6,5 @@ case "$action" in
|
|||
shutdown) systemctl poweroff -i ;;
|
||||
reboot) systemctl reboot ;;
|
||||
logout) systemctl --user exit ;;
|
||||
autostart) autostart-manage start ;;
|
||||
autostart) autostart-manage run ;;
|
||||
*) ;; esac
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue