You are not logged in.

#1 2005-04-06 12:16:51

FUBAR
Member
From: Belgium
Registered: 2004-12-08
Posts: 1,029
Website

[rc.d script] psyBNC

I made an rc.d-script for psyBNC. Sorry, didn't do a PKGBUILD, do it yourself! tongue

You have to edit PSYLOC (dir where psybnc is installed) and PSYUSER (the user you run psybnc as, try to run psybnc as this user manually first to be sure it'll work).

#!/bin/bash

PSYLOC=/home/fubar/psybnc
PSYUSER=fubar

. /etc/rc.conf
. /etc/rc.d/functions

PID=`cat $PSYLOC/psybnc.pid 2>/dev/null`
case "$1" in
  start)
    stat_busy "Starting psyBNC"
    [ -z "$PID" ] && cd $PSYLOC && su --command=$PSYLOC/psybnc $PSYUSER >/dev/null
    if [ $? -gt 0 ]; then
      stat_fail
    else
      add_daemon psybnc
      stat_done
    fi
    ;;
  stop)
    stat_busy "Stopping psyBNC"
    [ ! -z "$PID" ]  && kill -9 $PID &> /dev/null && rm $PSYLOC/psybnc.pid
    if [ $? -gt 0 ]; then
      stat_fail
    else
      rm_daemon psybnc
      stat_done
    fi
    ;;
  restart)
    $0 stop
    sleep 1
    $0 start
    ;;
  *)
    echo "usage: $0 {start|stop|restart}"  
esac
exit 0

A bus station is where a bus stops.
A train station is where a train stops.
On my desk I have a workstation.

Offline

Board footer

Powered by FluxBB