1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
#!/bin/bash
if [ ! -e /etc/xpilots.conf ]; then
touch /etc/xpilots.conf
chmod 644 /etc/xpilots.conf
chown root.root /etc/xpilots.conf
fi
grep -q AUTOSTART /etc/xpilots.conf || cat >>/etc/xpilots.conf <<EOF
# If you want the XPilot server to start automatically when the
# machine boots then set AUTOSTART to "YES".
AUTOSTART="NO"
EOF
grep -q DEFAULTMAP /etc/xpilots.conf || cat >>/etc/xpilots.conf <<EOF
# DEFAULTMAP specifies the complete path to the map you want the server
# to start at boot up.
DEFAULTMAP="/usr/share/games/xpilot/maps/blood-music.xp"
EOF
grep -q REPORTMETA /etc/xpilots.conf || cat >>/etc/xpilots.conf <<EOF
# Set REPORTMETA to "YES" and the xpilot server will automatically declare
# itself to the metasever when it boots.
REPORTMETA="NO"
EOF
grep -q OTHEROPTIONS /etc/xpilots.conf || cat >>/etc/xpilots.conf <<EOF
# Set OTHEROPTIONS to any additional options desired when the xpilot
# server starts, e.g.
#
# -timerResolution 100
# This hack attempts to make the frame rate more accurate.
# Without it, the server will be a fraction of a frame per second
# slower than the specified value. However, on a loaded system
# (e.g. running the distributed.net client) it has been found
# that -timerResolution is not effective, and ends up further
# slowing down the framerate.
#
# -clientPortStart 40000 -clientPortEnd 40009
# If the server is run behind an IP masquerading firewall which is
# set up to port-forward a range of ports to the server machine,
# this pair of switches establishes that range of ports which is
# used between each client and the server after a connection is
# negotiated (as distinct from the xpilot server port, which
# defaults to 15345 and is only used to initially establish the
# connection).
#
OTHEROPTIONS="-timerResolution 100"
EOF
adduser --system --home /var/run/xpilots --group \
--shell /bin/sh --disabled-password xpilots >/dev/null 2>&1
chmod 700 /var/run/xpilots
chown -R xpilots.xpilots /etc/xpilots
chmod -f 600 /etc/xpilots/password
# Normally added by dh_installinit, but included here manually because
# we customize the prerm and therefore run dh_installinit --noscripts.
if [ -x "/etc/init.d/xpilots" ]; then
update-rc.d xpilots defaults >/dev/null
/etc/init.d/xpilots start
fi
#DEBHELPER#
|