opnsense-ports/games/cube/files/cube_server.in
Franco Fichtner 8cb1a96ede ports: pull in a snapshot of the FreeBSD ports tree
Taken from:	https://github.com/freebsd/freebsd-ports.git
Commit id:	5070672073b68be364139bc6b3a89100bd17d331
2014-11-09 14:03:21 +01:00

23 lines
677 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
# 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
# ~/.cube, and create symlinks to the data files, but the configuration file
# is copied, and write permission for the user is added to it.
if [ -d ~/.cube ]
then
echo "Using existing ~/.cube directory."
else
echo "Creating ~/.cube directory."
cd %%DATADIR%% || exit 1
find * -type d -exec mkdir -p ~/.cube/{} \;
cp *.cfg ~/.cube && chmod u+w ~/.cube/*.cfg
find * -type f -exec ln -s %%DATADIR%%/{} ~/.cube/{} \; 2>/dev/null
fi
cd ~/.cube || exit 1
exec %%PREFIX%%/libexec/cube_server "$@"