Fixed startup script

master
Gina Häußge 2013-01-18 23:32:34 +01:00
parent 720f3b3eb6
commit cff0274c0c
1 changed files with 10 additions and 3 deletions

13
run Normal file → Executable file
View File

@ -1,7 +1,14 @@
#!/bin/sh
#!/bin/bash
PYTHON=`which python`
DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
cd $DIR
$PYTHON -m octoprint.server $@
$PYTHON -m octoprint.server $@