Add addbashrc.sh
This commit is contained in:
21
addbashrc.sh
Normal file
21
addbashrc.sh
Normal 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
|
||||
Reference in New Issue
Block a user