Created
March 17, 2015 18:18
-
-
Save bcalmac/58bde8f402aa0d82b92d to your computer and use it in GitHub Desktop.
Bash functions to start/stop/restart multiple services on Windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# start the services passed as arguments | |
function nst { for s in "$@"; do net start $s; done } | |
# stop the services passed as arguments | |
function nsp { for s in "$@"; do net stop $s; done } | |
# restart the services passed as arguments | |
function nrs { | |
# Stop in reverse order | |
for ((i=$#; i>0; i--)); do net stop ${!i}; done | |
for s in "$@"; do net start $s; done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment