pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

pastebin private pastebin - collaborative debugging tool What's a private pastebin?

Posted by Anonymous on Fri 16th Jan 14:26 (modification of post by view diff)
diff | download | new post

  1.         if [ -z "$2" ] || [ -z "$3" ]
  2.         then
  3.                 echo "Incorrect syntax!"
  4.                 exit 1
  5.         fi
  6.         if [ -e "$RUNDIR/pid/$2.dtach.pid" ]
  7.         then
  8.                 echo "Server is already running!"
  9.                 exit 1
  10.         fi
  11.         PORT=$3
  12.         while [ -f "$RUNDIR/port/port-$PORT" ] && [ ! -z `cat "$RUNDIR/port/port-$PORT"` ] && [ ! -z `ps -o pid --no-heading -p $(cat $RUNDIR/port/$PORT)` ]
  13.         do
  14.                 echo -n "Port $PORT is already in use. "
  15.                 PORT=$PORT+10
  16.                 echo "Trying port $PORT instead."
  17.         done
  18.         echo $PORT > $RUNDIR/port/name-$2
  19.         echo $2 > $RUNDIR/port/port-$PORT
  20.         echo "$0 create \"$2\" \"$PORT\" \"$4\"" > $RUNDIR/cmd/$2
  21.         CMD=`$DIR/gsc-$2.sh "$PORT" "$4"`
  22.         echo "dtach -n \"$RUNDIR/dtach/$2\" $DIR/gsc-run.sh \"$RUNDIR\" \"$DIR\" $CMD"
  23.         dtach -n "$RUNDIR/dtach/$2" $DIR/gsc-run.sh "$RUNDIR" "$DIR" $CMD
  24.         sleep 1  # TODO: remove this if possible
  25.         DTACHPID=`fuser $RUNDIR/dtach/$2 2> /dev/null | cut -f 2 -d ' '`
  26.         echo $DTACHPID > $RUNDIR/pid/$2.dtach.pid

Submit a correction or amendment below. (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Use syntax highlighting

To highlight particular lines, prefix each line with @@


Remember my settings