zsh/systemd.zsh

27 lines
819 B
Bash
Raw Normal View History

#! /bin/zsh
2023-10-05 10:14:04 +02:00
# SPDX-FileCopyrightText: 2023 Tobias Schmidl
#
# SPDX-License-Identifier: GPL-3.0-or-later
# shellcheck disable=all
2018-01-29 16:10:37 +01:00
user_commands=(
2023-10-05 10:14:04 +02:00
list-units is-active status show help list-unit-files
is-enabled list-jobs show-environment cat list-timers
is-system-running default rescue halt poweroff reboot
emergency kexec exit suspend hibernate hybrid-sleep)
2018-01-29 16:10:37 +01:00
sudo_commands=(
2023-10-05 10:14:04 +02:00
start stop reload restart try-restart isolate kill
reset-failed enable disable reenable preset mask unmask
link load cancel set-environment unset-environment
edit)
2018-01-29 16:10:37 +01:00
for c in $user_commands; do; alias sc-$c="systemctl $c"; done
for c in $sudo_commands; do; alias sc-$c="sudo systemctl $c"; done
alias sc-enable-now="sc-enable --now"
alias sc-disable-now="sc-disable --now"
alias sc-mask-now="sc-mask --now"