aboutsummaryrefslogtreecommitdiff
path: root/misc/linux-opengroupware/files/nhsd.sh.sample
diff options
context:
space:
mode:
Diffstat (limited to 'misc/linux-opengroupware/files/nhsd.sh.sample')
-rw-r--r--misc/linux-opengroupware/files/nhsd.sh.sample56
1 files changed, 56 insertions, 0 deletions
diff --git a/misc/linux-opengroupware/files/nhsd.sh.sample b/misc/linux-opengroupware/files/nhsd.sh.sample
new file mode 100644
index 000000000000..6a6106fbfd3e
--- /dev/null
+++ b/misc/linux-opengroupware/files/nhsd.sh.sample
@@ -0,0 +1,56 @@
+#!/bin/sh
+# $FreeBSD$
+#
+# Frank Reppin <frank.reppin@boerde.de>
+
+OGO_USER='ogo'
+OGO_GROUP='skyrix'
+NHSD_BIN='/compat/linux/opt/opengroupware.org/Tools/ix86/linux-gnu/gnu-fd-nil/nhsd'
+OGO_DIR='/compat/linux/opt/opengroupware.org'
+LOG='/var/log/opengroupware/xmlrpcd.log'
+
+
+case $1 in
+start)
+ [ ! -f ${LOG} ] && {
+ echo 'No NHSD logfile present in /var/log/opengroupware - creating one...'
+ touch ${LOG}
+ chmod 600 ${LOG}
+ chown ${OGO_USER}:${OGO_GROUP} ${LOG}
+ echo 'done!'
+ }
+
+ chmod 600 ${LOG}
+ chown ${OGO_USER}:${OGO_GROUP} ${LOG}
+
+ [ -x ${NHSD_BIN} ] && {
+ su -l ${OGO_USER} -c \
+ "./Tools/ix86/linux-gnu/gnu-fd-nil/nhsd >>${LOG} 2>&1 &"
+ echo 'Network Hotsync [tm] daemon started.'
+ echo "**** RECEIVED 'start' from STARTSCRIPT at `date` ****" >>${LOG}
+ }
+ ;;
+
+stop)
+ killall -9 nhsd >/dev/null 2>&1
+ killall -9 nhsd >/dev/null 2>&1
+ echo 'Network Hotsync [TM] daemon stopped.'
+ echo "" >>${LOG}
+ echo "**** RECEIVED 'stop' from STARTSCRIPT at `date` ****" >>${LOG}
+ ;;
+
+restart)
+
+ ./$0 stop
+ ./$0 start
+ ;;
+
+status)
+ ps auxwwwww|grep -vi grep|grep -i '/gnu-fd-nil/nhsd'
+ ;;
+
+*)
+ echo "usage: `basename $0` {start|stop|restart|status|}" >&2
+ exit 64
+ ;;
+esac