Skip to content

Instantly share code, notes, and snippets.

@pahud
Created March 30, 2015 13:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pahud/058ff3dd2e53f5c02a8c to your computer and use it in GitHub Desktop.
Save pahud/058ff3dd2e53f5c02a8c to your computer and use it in GitHub Desktop.
start pahud/shadowsocks-python if it's not running
#!/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
/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