Skip to content

Instantly share code, notes, and snippets.

@pahud
Created Mar 30, 2015
Embed
What would you like to do?
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