2 changed files with 23 additions and 0 deletions
@ -0,0 +1,22 @@ |
|||
#!/bin/bash |
|||
cd "$(dirname "$0")" |
|||
|
|||
CONTAINER=proxywg_socks_c |
|||
PINGHOST=8.8.8.8 |
|||
|
|||
CHECK_CONTAINER="$(docker ps | grep $CONTAINER | wc -l)" |
|||
if [ "$CHECK_CONTAINER" == "0" ]; then |
|||
echo 'container is not started' |
|||
docker compose up -d |
|||
exit 0 |
|||
fi |
|||
|
|||
RESULT="$(docker exec -it $CONTAINER ping -c 1 -W 1 $PINGHOST > /dev/null && echo 'pass' || echo 'fail')" |
|||
#echo $RESULT |
|||
|
|||
if [ "$RESULT" != "pass" ]; then |
|||
echo 'container is not good' |
|||
docker compose down |
|||
docker compose up -d |
|||
exit 0 |
|||
fi |
Loading…
Reference in new issue