From: <abe...@us...> - 2017-01-15 01:34:35
|
Revision: 8096 http://sourceforge.net/p/astlinux/code/8096 Author: abelbeck Date: 2017-01-15 01:34:33 +0000 (Sun, 15 Jan 2017) Log Message: ----------- acme, acme-client command, natively handle some options Modified Paths: -------------- branches/1.0/package/acme/acme-client.sh Modified: branches/1.0/package/acme/acme-client.sh =================================================================== --- branches/1.0/package/acme/acme-client.sh 2017-01-14 22:29:31 UTC (rev 8095) +++ branches/1.0/package/acme/acme-client.sh 2017-01-15 01:34:33 UTC (rev 8096) @@ -25,12 +25,50 @@ exit 1 fi -# Robust 'bash' method of creating/testing for a lockfile -if ! ( set -o noclobber; echo "$$" > "$LOCKFILE" ) 2>/dev/null; then - echo "acme-client: already running, lockfile \"$LOCKFILE\" exists, process id: $(cat "$LOCKFILE")." >&2 - exit 9 -fi +add_cron_entry() +{ + echo "acme-client: TODO installcronjob." +} +del_cron_entry() +{ + echo "acme-client: TODO uninstallcronjob." +} + +no_op_arg() +{ + echo "acme-client: The $1 option has been disabled." +} + +special_arg_handler() +{ + local arg skip IFS + + IFS='~' # expand command-line args using the unique 'tilde' character + for arg in $*; do + skip=0 + case "$arg" in + --installcronjob) + add_cron_entry ; skip=1 ;; + --uninstallcronjob) + del_cron_entry ; skip=1 ;; + --install) + no_op_arg "$arg" ; skip=1 ;; + --uninstall) + no_op_arg "$arg" ; skip=1 ;; + --upgrade) + no_op_arg "$arg" ; skip=1 ;; + --auto-upgrade) + no_op_arg "$arg" ; skip=1 ;; + esac + if [ $skip -eq 1 ]; then + return 0 + fi + done + + return 1 +} + add_account_opts() { local file="$1" line opt value IFS @@ -49,6 +87,16 @@ done } +if special_arg_handler "$@"; then + exit 0 +fi + +# Robust 'bash' method of creating/testing for a lockfile +if ! ( set -o noclobber; echo "$$" > "$LOCKFILE" ) 2>/dev/null; then + echo "acme-client: already running, lockfile \"$LOCKFILE\" exists, process id: $(cat "$LOCKFILE")." >&2 + exit 9 +fi + accountemail="$ACME_ACCOUNT_EMAIL" # Extract from possible <a@b.tld> format This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |