aboutsummaryrefslogtreecommitdiff
path: root/jatwisd
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2021-12-14 19:29:25 +0100
committerlonkaars <loek@pipeframe.xyz>2021-12-14 19:29:25 +0100
commit22f2cb4a046fad3cbb480860641ca4a40e21aacf (patch)
tree191961aff86b46ca481c32638560d062fe5caf1e /jatwisd
parent3e548d3d3f46c89ffa600c7329c92648e9c071e8 (diff)
in-between commit
Diffstat (limited to 'jatwisd')
-rwxr-xr-xjatwisd48
1 files changed, 48 insertions, 0 deletions
diff --git a/jatwisd b/jatwisd
new file mode 100755
index 0000000..71c2f40
--- /dev/null
+++ b/jatwisd
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+function usage() {
+ cat << EOF
+Usage: jatwisd [options]
+
+ --help
+ display (this) help message
+
+ -h, --https <https url>
+ poll url using https
+
+ -s, --sftp <sftp url>
+ poll url using sftp
+
+ -e, --exec
+ script to run if the url is reachable
+
+ -t, --timeout
+ timeout period (in milliseconds)
+
+ -f, --freq, --frequency
+ polling frequency
+
+ -l, --lockfile
+ set lockfile location and enable lockfile checking
+
+See jatwisd(1) for more info
+EOF
+}
+
+while [ "$1" != "" ]; do
+ PARAM=`echo $1 | awk -F= '{print $1}'`
+ VALUE=`echo $1 | awk -F= '{print $2}'`
+ case $PARAM in
+ --help)
+ usage
+ exit
+ ;;
+ *)
+ echo "ERROR: unknown parameter \"$PARAM\""
+ usage
+ exit 1
+ ;;
+ esac
+ shift
+done
+