3 # /etc/init.d/pci-nopaste
6 # Provides: pci-nopaste
7 # Required-Start: $local_fs $remote_fs $network
8 # Required-Stop: $local_fs $remote_fs $network
10 # Default-Stop: 0 1 2 6
11 # Short-Description: An obsolete implementation of no-paste, based on POE::Component::IRC
12 # Description: See http://git.cielonegro.org/gitweb.cgi?p=pci-nopaste.git;a=summary
15 pidfile="@localstatedir@/pci-nopaste/pci-nopaste.pid"
16 command="@DAEMON@ -cf -p $pidfile -- @bindir@/pci-nopaste"
17 command_args="--config=@sysconfdir@/pci-nopaste.conf"
18 pci_nopaste_user="no-paste"
22 echo -en "\\033[${RES_COL}G"
24 echo -en "\\033[1;32m"
26 echo -en "\\033[0;39m"
32 echo -en "\\033[${RES_COL}G"
34 echo -en "\\033[1;31m"
36 echo -en "\\033[0;39m"
41 if [ -s "$pidfile" ]; then
42 read _pid < "$pidfile"
44 if [ -n "$_pid" -a -d "/proc/$_pid" ]; then
45 echo "pci-nopaste (pid $_pid) is running..."
48 echo "pci-nopaste is not running."
52 echo "pci-nopaste is not running."
58 if status >/dev/null 2>&1; then
59 echo "pci-nopaste is already running."
63 echo -n "Starting pci-nopaste.."
64 /bin/su -s /bin/sh "$pci_nopaste_user" \
65 -c "$command $command_args"
68 if [ $RETVAL -eq 0 ]; then
78 if ! status >/dev/null 2>&1; then
79 echo "pci-nopaste not running? (check $pidfile)." 1>&2
83 echo -n "Stopping pci-nopaste: "
84 /bin/su -s /bin/sh "$pci_nopaste_user" \
113 restart|reload|force-reload)
122 echo "Usage: $0 {start|stop|status|restart|reload|force-reload}"