From 8c2686273232f30a6206644c2a8a531ff48cb211 Mon Sep 17 00:00:00 2001 From: tan <447542994@qq.com> Date: Mon, 7 Jan 2019 16:44:36 +0800 Subject: [PATCH] add docker.sh file to control compose file --- docker.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 docker.sh diff --git a/docker.sh b/docker.sh new file mode 100755 index 0000000..c65e895 --- /dev/null +++ b/docker.sh @@ -0,0 +1,32 @@ +#!/bin/bash +#author: tan +#date: 2019-01-07 +# a script to control docker's container create restart reload and rm function + +function checkSudo (){ + if [ $UID -ne 0 ];then + echo -e 'it must be root!' + echo -e 'usage ./docker.sh {run|restart|rm}' + exit 1 + fi +} + +checkSudo + +if [ $# -eq 1 ];then + + case $1 in + "run") + echo "run";; + + "restart") + echo "restart";; + + "rm") + echo "rm";; + + *) + echo -e 'usage ./docker.sh {run|restart|rm}';; + esac + +fi