Permalink
Browse files

better start / stop scripts

  • Loading branch information...
1 parent fd7ccbf commit 0b6a59db54840e323e891da79a9913536c7f68d0 @lformella committed Oct 19, 2012
Showing with 30 additions and 5 deletions.
  1. +0 −5 run.example.sh
  2. +16 −0 start.sh
  3. +14 −0 stop.sh
View
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-mono XG.Server.Cmd.exe > log.txt & pid=$!
-echo $pid > pid
-
View
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+SOURCE="${BASH_SOURCE[0]}"
+DIR="$( dirname "$SOURCE" )"
+while [ -h "$SOURCE" ]
+do
+ SOURCE="$(readlink "$SOURCE")"
+ [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
+ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
+done
+DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
+
+cd $DIR
+mono Server.Cmd.exe > log.txt & pid=$!
+echo $pid > pid
+
View
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+SOURCE="${BASH_SOURCE[0]}"
+DIR="$( dirname "$SOURCE" )"
+while [ -h "$SOURCE" ]
+do
+ SOURCE="$(readlink "$SOURCE")"
+ [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
+ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
+done
+DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
+
+cd $DIR
+kill -9 $(cat pid)

0 comments on commit 0b6a59d

Please sign in to comment.