Implememnt st command

This commit is contained in:
Austen Adler 2016-03-30 13:29:12 -04:00
parent 5e88162cd5
commit 59fa47cb95

View File

@ -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)