aboutsummaryrefslogtreecommitdiffstats
path: root/chinese/firebird/files/bbs.sh.example
blob: 084ec41aa027dd48e5c5dadbd81a8655d334f75f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
#
#   bbs.sh
#
#   $Id$

bbsd_port=23

case "$1" in
    start)
        if [ -x /usr/local/bbs/bin/bbsd ]; then
            /usr/local/bbs/bin/bbsd $bbsd_port && echo -n ' bbsd'
        fi
        if [ -x /usr/local/bbs/innd/innbbsd ]; then
            su bbs -c '/usr/local/bbs/innd/innbbsd' && echo -n ' bbs.innbbsd'
        fi
        if [ -f /usr/local/bbs/etc/cron.bbs ]; then
            su bbs -c 'crontab /usr/local/bbs/etc/cron.bbs' && echo -n ' bbs.cron'
        fi
        ;;
    stop)
        if [ -f /usr/local/bbs/log/bbsd.pid ]; then
            /bin/kill `cat /usr/local/bbs/log/bbsd.pid`
            /usr/bin/killall bbsd 2> /dev/null
            rm -fr /usr/local/bbs/log/bbsd.pid
            echo -n " -bbsd"
        else
            echo "bbsd does not start yet. (pid file not found.)"
        fi
        ;;
    *)
        echo ""
        echo "usage:  `basename $0` { start | stop }"
        echo ""
        exit 64
        ;;
esac