Implememnt st command
This commit is contained in:
parent
5e88162cd5
commit
59fa47cb95
19
shells/zshrc
19
shells/zshrc
@ -26,6 +26,25 @@ export EDITOR='vim'
|
||||
$ () {
|
||||
$*
|
||||
}
|
||||
st () {
|
||||
command="${@: -1}"
|
||||
while (( $# > 1 )); do
|
||||
if [[ "$command" == "r" ]]; then
|
||||
echo "Restarting $1"
|
||||
sudo service "$1" restart
|
||||
elif [[ "$command" == "s" ]]; then
|
||||
echo "Starting $1"
|
||||
sudo service "$1" start
|
||||
elif [[ "$command" == "x" ]]; then
|
||||
echo "Stopping $1"
|
||||
sudo service "$1" stop
|
||||
elif [[ "$command" == "i" ]]; then
|
||||
echo "Status of $1"
|
||||
service "$1" status
|
||||
fi
|
||||
shift
|
||||
done
|
||||
}
|
||||
asroot(){
|
||||
# Use temporary file for added security
|
||||
TEMPFILE=$(tempfile)
|
||||
|
Loading…
Reference in New Issue
Block a user