Generic bash scripts for Neverwinter Nights server management, running nwnx2 on Linux.
The scripts in this repository are generic and only depend on the environment variables specified in the YAML file. No script customization should be necessary in order to use this with any standard nwnx2 server environment.
nwserver is launched in a tmux session which can be shared between users of a specified group.
- nwnx2
- nwnstartup.sh (shell script to run nwserver with nwnx)
- customized YAML file (see default.yml)
- Clone
git clone https://github.com/jakkn/nwn-servermanagement.git
- Create your own YAML file
cd nwn-servermanagement && cp default.yml master.yml
- Edit the YAML file to fit the server environment
Field | Description | Default |
---|---|---|
server_directory | absolute path to the directory containing nwserver | /home/nwn/nwnserver |
user_group | the linux user group to share the tmx session with | nwn |
runscript | name of startup script in server directory | nwnstartup.sh |
socket_path | location of tmux session socket | /tmp/nwn_socket |
target_session | tmux session | nwn |
- Display help
./server-control.sh -h
- Start server
./server-control.sh -s master.yml
- Stop server
./server-control.sh -S [now|friendly] master.yml
- Restart server
./server-control.sh -r [now|friendly] master.yml
Example of Cron jobs that start two servers (main and test server) on computer boot, with weekly nwserver reboots
@reboot cd /home/nwn/nwn-servermanagement && ./server-control.sh -s master.yml >>/home/nwn/log/cron.log 2>&1
@reboot cd /home/nwn/nwn-servermanagement && ./server-control.sh -s develop.yml >>/home/nwn/log/cron.log 2>&1
00 13 * * 2 cd /home/nwn/nwn-servermanagement && ./server-control.sh -r friendly master.yml >>/home/nwn/log/cron.log 2>&1
00 13 * * 2 cd /home/nwn/nwn-servermanagement && ./server-control.sh -r friendly develop.yml >>/home/nwn/log/cron.log 2>&
Based on the work of eeriegeek at http://www.entropywizard.net/nwn/crontab-entry.txt