summaryrefslogtreecommitdiff
path: root/misc/upclient/files/upclient.sh
diff options
context:
space:
mode:
authorJames E. Housley <jeh@FreeBSD.org>2001-01-05 03:37:07 +0000
committerJames E. Housley <jeh@FreeBSD.org>2001-01-05 03:37:07 +0000
commit9efa8d4a6c744fc8f65de387a6c6e117e37134c5 (patch)
tree807e3cb9ad5c24e6f906c1465a868a9add5e952b /misc/upclient/files/upclient.sh
parentUpdate to 8.11.2 (diff)
Major update from 3.04 to 4.2.1.19
PR: 23948 Submitted by: Cyrille Lefevre <clefevre@citeweb.net>
Notes
Notes: svn path=/head/; revision=36804
Diffstat (limited to 'misc/upclient/files/upclient.sh')
-rw-r--r--misc/upclient/files/upclient.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/misc/upclient/files/upclient.sh b/misc/upclient/files/upclient.sh
new file mode 100644
index 000000000000..70470e68b6fa
--- /dev/null
+++ b/misc/upclient/files/upclient.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
+ echo "$0: Cannot determine the PREFIX" >&2
+ exit 1
+fi
+
+if [ -f ${PREFIX}/etc/upclient.conf ]; then
+ if grep -qs '^[ ]*AuthKey[ ]*=' ${PREFIX}/etc/upclient.conf; then
+ if grep -qs '^[ ]*AuthKey[ ]*=[ ]*<your_authkey>' ${PREFIX}/etc/upclient.conf; then
+ echo "upclient: AuthKey not configured in ${PREFIX}/etc/upclient.conf -- aborted." >&2
+ exit 1
+ fi
+ else
+ echo "upclient: ${PREFIX}/etc/upclient.conf is out of date -- aborted." >&2
+ exit 1
+ fi
+else
+ echo "upclient: ${PREFIX}/etc/upclient.conf doesn't exist -- aborted." >&2
+ exit 1
+fi
+
+case "$1" in
+start)
+ [ -x ${PREFIX}/sbin/upclient ] && ${PREFIX}/sbin/upclient > /dev/null && echo -n ' upclient'
+ ;;
+stop)
+ [ -r /var/run/upclient.pid ] && kill `cat /var/run/upclient.pid` > /dev/null && echo -n ' upclient'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0