]> arthur.barton.de Git - ngircd-alex.git/blob - contrib/ngircd-bsd.sh
Test suite/platformtest.sh: Detect when tests have been skipped
[ngircd-alex.git] / contrib / ngircd-bsd.sh
1 #!/bin/sh
2
3 # PROVIDE: ngircd
4 # REQUIRE: NETWORKING SERVERS
5 # BEFORE: DAEMON
6 # KEYWORD: FreeBSD shutdown
7
8 # Add the following line to /etc/rc.conf to enable `ngircd':
9 #
10 #ngircd_enable="YES"
11 #
12
13 . "/etc/rc.subr"
14
15 name="ngircd"
16 rcvar=`set_rcvar`
17
18 command="/usr/local/sbin/ngircd"
19 command_args=""
20
21 load_rc_config "$name"
22 : ${ngircd_enable="NO"}
23 : ${ngircd_flags=""}
24
25 required_files="/usr/local/etc/$name.conf"
26 pidfile="${ngircd_pidfile:-/var/run/${name}/${name}.pid}"
27
28 if [ ! x"${ngircd_chrootdir}" = x ];then
29         # Mount a devfs in the chroot directory if needed
30         if [ ! -c ${ngircd_chrootdir}/dev/random \
31           -o ! -c ${ngircd_chrootdir}/dev/null ]; then
32                 umount ${ngircd_chrootdir}/dev 2>/dev/null
33                 mount_devfs devfs ${ngircd_chrootdir}/dev
34         fi
35
36         devfs -m ${ngircd_chrootdir}/dev rule apply hide
37         devfs -m ${ngircd_chrootdir}/dev rule apply path null unhide
38         devfs -m ${ngircd_chrootdir}/dev rule apply path random unhide
39
40         # Copy local timezone information if it is not up to date.
41         if [ -f /etc/localtime ]; then
42                 cmp -s /etc/localtime "${named_chrootdir}/etc/localtime" || \
43                         cp -p /etc/localtime "${named_chrootdir}/etc/localtime"
44         fi
45
46         pidfile="${ngircd_chrootdir}${pidfile}"
47 fi
48
49 run_rc_command "$1"
50
51 # -eof-