Add addbashrc.sh

This commit is contained in:
2026-02-19 08:41:32 +00:00
commit f665ff44f0

21
addbashrc.sh Normal file
View File

@@ -0,0 +1,21 @@
#!/bin/bash
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