Update addbashrc

This commit is contained in:
2026-02-19 11:06:45 +00:00
parent f665ff44f0
commit 44c58f81f8

20
addbashrc Normal file
View File

@@ -0,0 +1,20 @@
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