aboutsummaryrefslogtreecommitdiff
path: root/irc/bopm/files
diff options
context:
space:
mode:
authorPav Lucistnik <pav@FreeBSD.org>2006-10-31 12:00:37 +0000
committerPav Lucistnik <pav@FreeBSD.org>2006-10-31 12:00:37 +0000
commit1af9d66933414386014d2834a482df29817ba6ea (patch)
tree2e041e6f405e184752029cfb26df431defe5eb96 /irc/bopm/files
parentdf1ebc168389af9be7e53b89c0622b85f6bfcbbc (diff)
downloadports-1af9d66933414386014d2834a482df29817ba6ea.tar.gz
ports-1af9d66933414386014d2834a482df29817ba6ea.zip
Notes
Diffstat (limited to 'irc/bopm/files')
-rw-r--r--irc/bopm/files/bopm.in38
-rw-r--r--irc/bopm/files/bopm.sh.sample24
-rw-r--r--irc/bopm/files/pkg-deinstall.in17
-rw-r--r--irc/bopm/files/pkg-install.in48
-rw-r--r--irc/bopm/files/pkg-message.in13
5 files changed, 116 insertions, 24 deletions
diff --git a/irc/bopm/files/bopm.in b/irc/bopm/files/bopm.in
new file mode 100644
index 000000000000..96bc4fb8c14c
--- /dev/null
+++ b/irc/bopm/files/bopm.in
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+# PROVIDE: bopm
+# REQUIRE: DAEMON
+# KEYWORD: shutdown
+
+#
+# Add the following line to /etc/rc.conf to enable bopm:
+# bopm_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable bopm.
+# bopm_config (str): Default to "%%PREFIX%%/etc/bopm.conf"
+# Configuration file for bopm.
+# bopm_flags (str): Custom flags passed to the bopm
+# daemon (default empty).
+#
+. %%RC_SUBR%%
+
+name="bopm"
+rcvar=`set_rcvar`
+
+load_rc_config $name
+
+: ${bopm_enable="NO"}
+: ${bopm_config="%%PREFIX%%/etc/bopm.conf"}
+: ${bopm_flags=""}
+
+bopm_user="bopm"
+pidfile="%%LOGDIR%%/bopm.pid"
+required_files="${bopm_config}"
+
+# NOTE: bopm behaves differently with or without the -d flag.
+# If you choose to use -d, you will probably need to redirect
+# stdout and stderr to appropriate places.
+#
+command="%%PREFIX%%/bin/bopm"
+command_args="${bopm_flags} &"
+
+run_rc_command "$1"
diff --git a/irc/bopm/files/bopm.sh.sample b/irc/bopm/files/bopm.sh.sample
deleted file mode 100644
index 5a2adbea0208..000000000000
--- a/irc/bopm/files/bopm.sh.sample
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-PREFIX=$(expr $0 : "\(/.*/\)etc/rc\.d/$(basename $0)\$")
-
-BOPM=${PREFIX}bin/bopm
-
-case "$1" in
-start)
- if [ -x $BOPM ]; then
- su bopm -c $BOPM -d >/dev/null 2>&1
- echo -n ' bopm'
- fi
- ;;
-stop)
-# kill `cat ${PREFIX}/etc/ircd-hybrid-ru/ircd.pid` >/dev/null 2>&1
- killall bopm >/dev/null 2>&1
- echo -n ' bopm'
- ;;
-*)
- echo "Usage: `basename $0` {start|stop}" >&2
- ;;
-esac
-
-exit 0
diff --git a/irc/bopm/files/pkg-deinstall.in b/irc/bopm/files/pkg-deinstall.in
new file mode 100644
index 000000000000..1efb18528816
--- /dev/null
+++ b/irc/bopm/files/pkg-deinstall.in
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+#-----------------------------------------------------------------------
+if [ "x$2" = "xPOST-DEINSTALL" ]; then
+#-----------------------------------------------------------------------
+
+if [ -d %%LOGDIR%% ]
+then
+ rm -f %%LOGDIR%%/bopm.pid 2>/dev/null
+ rmdir %%LOGDIR%% 2>/dev/null || echo "The logs in %%LOGDIR%% will remain untouched after the port is deinstalled."
+fi
+
+#-----------------------------------------------------------------------
+fi
+#-----------------------------------------------------------------------
+
+exit 0
diff --git a/irc/bopm/files/pkg-install.in b/irc/bopm/files/pkg-install.in
new file mode 100644
index 000000000000..10a5a457acaa
--- /dev/null
+++ b/irc/bopm/files/pkg-install.in
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+# This script is a modified copy of the pkg-install script
+# from the ircd-hybrid-ru port.
+
+PATH=/bin:/usr/bin:/usr/sbin
+
+#-----------------------------------------------------------------------
+if [ "x$2" = "xPRE-INSTALL" ]; then
+#-----------------------------------------------------------------------
+
+USER=bopm
+GROUP=${USER}
+UID=717
+GID=${UID}
+SHELL=/bin/sh
+HOMEDIR=/nonexistent
+GECOS="Blitzed Open Proxy Monitor"
+
+if pw group show "${GROUP}" 2>/dev/null; then
+ echo "You already have a group \"${GROUP}\", so I will use it."
+else
+ if pw groupadd ${GROUP} -g ${GID}; then
+ echo "Added group \"${GROUP}\"."
+ else
+ echo "Adding group \"${GROUP}\" failed..."
+ exit 1
+ fi
+fi
+
+if pw user show "${USER}" 2>/dev/null; then
+ echo "You already have a user \"${USER}\", so I will use it."
+else
+ if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
+ -d ${HOMEDIR} -s ${SHELL} -c "${GECOS}"
+ then
+ echo "Added user \"${USER}\"."
+ else
+ echo "Adding user \"${USER}\" failed..."
+ exit 1
+ fi
+fi
+
+#-----------------------------------------------------------------------
+fi
+#-----------------------------------------------------------------------
+
+exit 0
diff --git a/irc/bopm/files/pkg-message.in b/irc/bopm/files/pkg-message.in
new file mode 100644
index 000000000000..ae25c2f16eb8
--- /dev/null
+++ b/irc/bopm/files/pkg-message.in
@@ -0,0 +1,13 @@
+-----------------------------------------------------------------
+bopm has been installed. Here are some installation details:
+
+user bopm (uid 717) and group bopm (gid 717) have been added
+to passwd(5) and group(5).
+
+bopm sample conf: %%PREFIX%%/etc/bopm.conf.sample
+bopm rc script: %%PREFIX%%/etc/rc.d/bopm
+bopm log dir: %%LOGDIR%%
+
+Please be sure to create %%PREFIX%%/etc/bopm.conf before
+starting this daemon.
+-----------------------------------------------------------------