made use of the readlink command

This commit is contained in:
Gunter Labes 2009-05-23 22:24:45 +00:00
parent 4342bfebf6
commit 6eedb15c65
2 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,7 @@ echo=""
[ "$1" = "-n" ] && { echo=echo; shift; }
[ $1 -ge 1 ] || die "New version must be greater than 1!"
DEV_VERSION=1.5
DEV_VERSION=$(readlink $HOME/servers/dev)
NEW_VERSION=$DEV_VERSION.$1
PREV_VERSION=$DEV_VERSION.$(($1-1))
PPREV_VERSION=$DEV_VERSION.$(($1-2))

View File

@ -66,8 +66,8 @@ do
[ -x bin/wesnothd-$SERVER ] || die "Executable 'bin/wesnothd-$SERVER' not found."
DATE=$(date +"%Y%m%d-%H%M%S")
[ ! -f "$SERVERBASE"/redirect.cfg ] || PORT=$(sed -nre '/port=/s/[ \t]*port="?([0-9]+)"?/\1/p' "$SERVERBASE"/redirect.cfg)
BUILDDIR=$(ls -ld "$SERVERBASE"/build | sed -nre 's,.*(\.\./builds/wesnothd-[^ ]+/),\1,p')
[ -r "$SERVERBASE"/redirect.cfg ] && PORT=$(sed -nre '/port=/s/[ \t]*port="?([0-9]+)"?/\1/p' "$SERVERBASE"/redirect.cfg)
BUILDDIR=$(readlink "$SERVERBASE"/build)
REV=r$(echo $BUILDDIR | sed -nre "s,.*wesnothd-svn-([0-9:SM]+)_$SERVER/$,\1,p")
LOG="wesnothd.$DATE.$REV.log"
bin/wesnothd-$SERVER -c "$SERVERBASE"/wesnothd.cfg --port $PORT --threads $THREADS $PARAMETERS > "$SERVERBASE/logs/$LOG" 2>&1 &