aboutsummaryrefslogtreecommitdiff
path: root/games/assaultcube/files/actioncube_server.in
blob: 6043d6db61618b313342c3ecfa2d31cb3605b85b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

# The executable needs to be run from its data directory, and needs to store
# configuration in it. We therefore mirror the data directory hierarchy in
# ~/.XXX, and create symlinks to the data files, but the configuration files
# are copied, and write permission for the user is added to them.

APPNAME="actioncube"

if [ -d ~/.$APPNAME ]
then
	echo "Using existing ~/.$APPNAME directory."
else
	echo "Creating ~/.$APPNAME directory."
	cd %%DATADIR%% || exit 1
	find * -type d -exec mkdir -p ~/.$APPNAME/{} \;
	find * -type f -name "*.cfg" \
	    -exec cp %%DATADIR%%/{} ~/.$APPNAME/{} \; \
	    -exec chmod u+w ~/.$APPNAME/{} \; 2>/dev/null
	find * -type f -exec ln -s %%DATADIR%%/{} ~/.$APPNAME/{} \; 2>/dev/null
fi

cd ~/.$APPNAME || exit 1
exec %%PREFIX%%/libexec/${APPNAME}_server "$@"