Created
March 30, 2015 13:45
-
-
Save pahud/058ff3dd2e53f5c02a8c to your computer and use it in GitHub Desktop.
start pahud/shadowsocks-python if it's not running
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 | |
#set -x | |
dockercmd='/usr/bin/docker' | |
s=$( $dockercmd inspect --format='{{.State.Running }}' ss 2>&1) | |
if [ $? -ne 0 ]; then | |
echo "not 0" | |
/root/shadowsocks-python/start.sh | |
elif [ "${s}X" == "falseX" ]; then | |
echo "not running" | |
$dockercmd rm ss | |
else | |
echo "running" | |
fi |
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
/usr/bin/docker run -d \ | |
--name ss \ | |
-p 443:443 \ | |
-p 8080:8080 \ | |
-p 8381:8381 \ | |
-p 8382:8382 \ | |
-p 8383:8383 \ | |
-p 8384:8384 \ | |
pahud/shadowsocks-python |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment