@@ -1,4 +1,19 @@
#/bin/bash
+
+deploy() {
+ ips=($@)
+ for i in "${!ips[@]}"
+ do
+ if [ $i -gt 1 ]; then
+ ip=${ips[$i]}
+ echo $ip "发布中..."
+ scp /home/server-deploy/crawler-etl.sh $ip:/home/crawler-etl.sh
+ ssh $ip "sh /home/crawler-etl.sh restart $2"
+ echo $ip "发布完成!"
+ fi
+ done
+}
start() {
CID=$(docker ps -a | grep crawler-etl | awk '{print $1}')
if [ ! $CID ]; then
@@ -37,14 +52,17 @@ update() {
}
case "$1" in
+'deploy')
+ deploy $@
+ ;;
'start')
start $2
;;
'stop')
- stop $2
+ stop
'restart')
'update')