all-in-one/Containers/watchtower/start.sh
szaimen 4b28a6a7d7 migrate watchtower container to alpine
Signed-off-by: szaimen <szaimen@e.mail.de>
2022-02-09 20:43:09 +01:00

19 lines
505 B
Bash

#!/bin/bash
# Check if socket is available and readable
if ! [ -a "/var/run/docker.sock" ]; then
echo "Docker socket is not available. Cannot continue."
exit 1
elif ! test -r /var/run/docker.sock; then
echo "Docker socket is not readable by the root user. Cannot continue."
exit 1
fi
if [ -n "$CONTAINER_TO_UPDATE" ]; then
exec /watchtower --cleanup --run-once "$CONTAINER_TO_UPDATE"
else
echo "'CONTAINER_TO_UPDATE' is not set. Cannot update anything."
exit 1
fi
exec "$@"