From 831b2a508e7cfc0d9a15ccf4524875ad38ecd376 Mon Sep 17 00:00:00 2001 From: hillerliao Date: Sat, 14 May 2022 11:03:31 +0800 Subject: [PATCH] add restart docker sh --- bin/restart_docker.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 bin/restart_docker.sh diff --git a/bin/restart_docker.sh b/bin/restart_docker.sh new file mode 100644 index 0000000..d63e353 --- /dev/null +++ b/bin/restart_docker.sh @@ -0,0 +1,11 @@ +#! /bin/bash +echo "重启Docker容器名称为: rsshub">>/home/lxf/log/restartdocker.log +docker restart rsshub +echo "重启命令的执行状态:"$?>>/home/lxf/log/restartdocker.log +if [ $? -eq 0 ]; then + echo "执行成功!">> /home/lxf/log/restartdocker.log +else + echo "执行失败!">> //home/lxf/log/restartdocker.log + exit +fi +echo "重启Docker容器: rsshub 完毕!输出日志在/home/lxf/log/restartdocker.log中">> /home/lxf/log/restartdocker.log \ No newline at end of file