Files
bash_restart/addbashrc

20 lines
412 B
Plaintext

cat >> ~/.bashrc <<EOF
rs ()
{
sudo systemctl restart $1
sleep 1
sudo systemctl status $1
}
source /usr/share/bash-completion/completions/systemctl
_systemctl_restart()
{
comps=$( __get_restartable_units --system "${COMP_WORDS[1]}" )
compopt -o filenames
COMPREPLY=( $(compgen -o filenames -W '$comps') )
return 0
}
complete -F _systemctl_restart rs
EOF