diff options
| author | Mistivia <i@mistivia.com> | 2025-11-02 15:29:28 +0800 |
|---|---|---|
| committer | Mistivia <i@mistivia.com> | 2025-11-02 15:29:28 +0800 |
| commit | 9f42c2d5f911cb4e215d7873221e642ce7df4d61 (patch) | |
| tree | 6dac90a889a7402a9556d3d1bcc5cb53cdb9f123 /deprecated-ngircd/contrib/ngircd-bsd.sh | |
| parent | fb2d9de539b660a261af19b1cbcceb7ee7980cb1 (diff) | |
deprecate webircdateway and ngircd
Diffstat (limited to 'deprecated-ngircd/contrib/ngircd-bsd.sh')
| -rwxr-xr-x | deprecated-ngircd/contrib/ngircd-bsd.sh | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/deprecated-ngircd/contrib/ngircd-bsd.sh b/deprecated-ngircd/contrib/ngircd-bsd.sh new file mode 100755 index 0000000..e085646 --- /dev/null +++ b/deprecated-ngircd/contrib/ngircd-bsd.sh @@ -0,0 +1,51 @@ +#!/bin/sh + +# PROVIDE: ngircd +# REQUIRE: NETWORKING SERVERS +# BEFORE: DAEMON +# KEYWORD: FreeBSD shutdown + +# Add the following line to /etc/rc.conf to enable `ngircd': +# +#ngircd_enable="YES" +# + +. "/etc/rc.subr" + +name="ngircd" +rcvar=`set_rcvar` + +command="/usr/local/sbin/ngircd" +command_args="" + +load_rc_config "$name" +: ${ngircd_enable="NO"} +: ${ngircd_flags=""} + +required_files="/usr/local/etc/$name.conf" +pidfile="${ngircd_pidfile:-/var/run/${name}/${name}.pid}" + +if [ ! x"${ngircd_chrootdir}" = x ];then + # Mount a devfs in the chroot directory if needed + if [ ! -c ${ngircd_chrootdir}/dev/random \ + -o ! -c ${ngircd_chrootdir}/dev/null ]; then + umount ${ngircd_chrootdir}/dev 2>/dev/null + mount_devfs devfs ${ngircd_chrootdir}/dev + fi + + devfs -m ${ngircd_chrootdir}/dev rule apply hide + devfs -m ${ngircd_chrootdir}/dev rule apply path null unhide + devfs -m ${ngircd_chrootdir}/dev rule apply path random unhide + + # Copy local timezone information if it is not up to date. + if [ -f /etc/localtime ]; then + cmp -s /etc/localtime "${named_chrootdir}/etc/localtime" || \ + cp -p /etc/localtime "${named_chrootdir}/etc/localtime" + fi + + pidfile="${ngircd_chrootdir}${pidfile}" +fi + +run_rc_command "$1" + +# -eof- |
