diff options
| author | Robert Günzler <r@gnzler.io> | 2022-11-18 18:07:38 +0100 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2022-11-18 18:38:21 +0100 |
| commit | f005fbf41646437964458d4c2028e6fdc04b59a1 (patch) | |
| tree | 2db56c1d202137278c5642ed418123b882d35dc5 /bin/cronic | |
| parent | 5e6e8da510836bbb0c7ac1602d51a394ba02ab2b (diff) | |
bin: add a few scripts
Diffstat (limited to 'bin/cronic')
| -rwxr-xr-x | bin/cronic | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/bin/cronic b/bin/cronic new file mode 100755 index 0000000..804f803 --- /dev/null +++ b/bin/cronic @@ -0,0 +1,30 @@ +#!/bin/sh + +set -e +[ -n "$DEBUG" ] && set -x + +guienter= +while getopts Gh opt; do + case "$opt" in + G) guienter=1 ;; + h | ?) + printf "usage: %s [ARGS...]\n" "$(basename "$0")" + printf "\n" + printf "converts reasonably behaved programs that return a nonzero exit status\n" + printf "into the back-asswards behavior cron expects, which is that printing text\n" + printf "to stdout means an error occurred and any status code, successful or not,\n" + printf "is disregarded.\n" + printf "\n" + printf " -G gui-enter as current user\n" + printf "\n" + exit 2 + ;; + esac +done +shift $((OPTIND - 1)) + +if [ -n "$guienter" ]; then + set -- /home/robert/bin/gui-enter "$(id -un)" "$@" +fi + +"$@" 1>&2 || printf "error. check stderr\n" |