#!/bin/sh set -u VERSION="22.05" show_version() { cat <, Jérémy Lecour and others. ansible-commit comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. See the GNU General Public Licence for details. END } show_help() { cat <&2 exit 1 fi ;; --message=?*) # message options, with value speparated by = MESSAGE=${1#*=} ;; --message=) # message options, without value printf 'FAILED: "--message" requires a non-empty option argument.\n' >&2 exit 1 ;; --no-lxc) LXC=0 ;; -n|--dry-run) # disable actual commands DRY_RUN=1 ;; -v|--verbose) # print verbose information VERBOSE=1 ;; --) # End of all options. shift break ;; -?*|[[:alnum:]]*) # ignore unknown options printf 'FAILED: Unknown option (ignored): %s\n' "$1" >&2 ;; *) # Default case: If no more options then break out of the loop. break ;; esac shift done if [ -z "${MESSAGE}" ]; then echo "FAILED: missing message parameter" >&2 show_usage exit 1 fi DRY_RUN=${DRY_RUN:-0} VERBOSE=${VERBOSE:-0} LXC=${LXC:-1} evocommit_bin=$(command -v evocommit) if [ -z "${evocommit_bin}" ]; then echo "FAILED: evocommit not found" >&2 exit 1 fi lxc_ls_bin=$(command -v lxc-ls) lxc_config_bin=$(command -v lxc-config) main