Created
March 19, 2015 17:27
-
-
Save or9/a2830ec33942aa5e70de to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
servers=( | |
# Servers to start | |
# Store location in separate script file so gnome-terminal doesn't get confused | |
"/home/drahman/StartServerTomcat8" | |
"/home/drahman/StartServerGeronimo" | |
#"/usr/share/tomcat/bin/catalina.sh\ run" | |
#"/usr/share/geronimo/bin/geronimo\ run" | |
) | |
titles=( | |
# Server titles based on $servers' index | |
"Apache Tomcat 8 server" | |
"Apache Geronimo server" | |
) | |
run_new_term() { | |
# $1:cmd, $2:title | |
echo "Opening $2; running $1" | |
gnome-terminal --title="$2" --window-with-profile="Servers" -e "sudo /bin/bash -c '$1; exec /bin/bash -i'" | |
# gnome-terminal --tab --title="$title" --window-with-profile="Servers" -e "sudo $2" | |
} | |
for ((i = 0; i < ${#servers[@]}; i++)) | |
do | |
#echo "${servers[$i]}" "${titles[$i]}" | |
run_new_term "${servers[$i]}" "${titles[$i]}" | |
done | |
exit $? |
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
#!/bin/bash | |
/usr/share/geronimo/bin/geronimo run | |
exit $? |
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
#!/bin/bash | |
/usr/share/tomcat/bin/catalina.sh run | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment