This page is READ-ONLY. It is generated from the old site.
All timestamps are relative to 2013 (when this page is generated).
If you are looking for TeX support, please go to VietTUG.org

wesnothd: startup script for archlinux user

wesnoth daemon on archlinux :)
Added by over 2 years ago  »  Votes: 1/1

Here's a startup script for Wesnothd on ArchLinux. The file location is /etc/rc.d/wesnothd, and you should install the daemon in /etc/rc.conf as a normal daemon. The wesnothd will listen on the port 15000, with 5 threads for network I/O.

 1 #!/bin/bash
 2 #
 3 # Purpose: Start/stop wesnoth game daemon
 4 # Author:  Anh K. Huynh
 5 # License: public domain
 6 # NOTES:   Script inspired from /etc/rc.d/gmond
 7 #
 8 
 9 . /etc/rc.conf
10 . /etc/rc.d/functions
11 
12 PID=`pidof -o %PPID /usr/bin/wesnothd`
13 case "$1" in
14   start)
15     stat_busy "Starting Wesnoth daemon" 
16     [ -z "$PID" ] && /usr/bin/wesnothd -d -p 15000 -t 5 >/dev/null 2>&1
17     if [ $? -gt 0 ]; then
18       stat_fail
19     else
20       add_daemon wesnothd
21       stat_done
22     fi
23     ;;
24   stop)
25     stat_busy "Stopping Wesnoth daemon" 
26     [ ! -z "$PID" ]  && kill $PID > /dev/null
27     if [ $? -gt 0 ]; then
28       stat_fail
29     else
30       rm_daemon wesnothd
31       stat_done
32     fi
33     ;;
34   restart)
35     $0 stop
36     sleep 1
37     $0 start
38     ;;
39   *)
40     echo "usage: $0 {start|stop|restart}" 
41 esac
42 
43 exit 0

Comments

Added by hoangtran over 2 years ago

wesnoth là cái này hả bác Kỳ http://www.wesnoth.org/

Added by over 2 years ago

Đúng rồi. Mình với Việt Long có oánh nhau trong wesnoth đó. Giờ mình tìm cách cài một cái daemon để chơi cho dễ :)