Newer
Older
#!/bin/bash
# $1: port number to run the server
# $2: filename to log output
Joris ten Tusscher
committed
PORT="${1:-8080}"
LOG="${2:-out.log}"
# Get latest HEAD
git pull origin master
# Build project
stack build
# Kill previous process
pkill javawlp
Joris ten Tusscher
committed
# Backup previous log if it exists by appending it to a backup file.
[[ -f $LOG ]] && cat $LOG >> "$LOG".backup
# Run server
nohup stack exec javawlp -- --runServer -p $PORT > $LOG &