--- /dev/null
+#!/bin/bash
+
+NAME=watchtower_check
+
+function usage ()
+{
+ echo "Usage: $NAME <arguments>"
+ echo "Run watchtower standonle to check container update"
+ echo
+ echo "Example: $NAME"
+ echo " or: $NAME -n"
+ echo " or: $NAME --notifications"
+ echo
+ echo "Arguments:"
+ echo " <no arguments> Run without sending email notifications"
+ echo " -n, --notifications Run sending email notifications"
+}
+
+function parse_options ()
+{
+ # Check Options
+ OPT=$(getopt -o nh --long notifications,help -n "$NAME parse-error" -- "$@")
+ # Bad arguments
+ if [ $? -ne 0 ]; then
+ usage
+ fi
+
+ # No Arguments
+ if [ $# -eq 0 ]; then
+ run_without_notifications
+ fi
+
+ eval set -- "$OPT"
+
+ # Parse Options
+ while [ $# -gt 0 ]; do
+ case $1 in
+ -n | --notifications )
+ run_with_notifications
+ shift
+ ;;
+ -h | --help )
+ usage
+ shift
+ ;;
+ * ) shift ;;
+ esac
+ done
+}
+
+run_without_notifications()
+{
+ docker run --rm \
+ -v /var/run/docker.sock:/var/run/docker.sock \
+ containrrr/watchtower \
+ --cleanup \
+ --run-once \
+ --no-startup-message
+}
+
+run_with_notifications()
+{
+ docker run --rm \
+ -v /var/run/docker.sock:/var/run/docker.sock \
+ containrrr/watchtower \
+ --cleanup \
+ --run-once \
+ --no-startup-message \
+ --notifications=email \
+ --notification-email-from=docker@giorgioravera.it \
+ --notification-email-to=giorgio.ravera@gmail.com \
+ --notification-email-server=mail.giorgioravera.it
+}
+
+parse_options $@