updated on Mon Jan 16 20:00:43 UTC 2012
[aur-mirror.git] / tiefighter-collector-cdrom / libtiefighter.sh
blobb30f0fad63cbdf6c5e9b0249dccb9a2379db454d
1 tiefighter.run() {
2 local APP_NAME="tiefighter"
3 local TMPDIR="${TMPDIR:-/tmp}"
4 local RW_BRANCH="${XDG_DATA_HOME}/${APP_NAME}"
5 local APP_DIR="${TMPDIR}/${APP_NAME}-tmp-${USER}"
6 local APP_DISK="/usr/share/games/${APP_NAME}/disk"
7 local BRANCHES_D="/etc/${APP_NAME}.d"
8 local DOSBOX_CONF="${XDG_CONFIG_HOME}/${APP_NAME}/$(basename $(dosbox -printconf))"
9 local __firstRun=false
11 if [ ! -f "${DOSBOX_CONF}" ]; then
12 install -Dm644 $(dosbox -printconf) "${DOSBOX_CONF}"
15 if [ ! -d "${RW_BRANCH}" ]; then
16 __firstRun=true
19 mkdir -p "${RW_BRANCH}" "${APP_DIR}" &&
20 RW_BRANCH="${RW_BRANCH}" modfs -o cow -o "uid=${UID}" -o "gid=${GROUPS[0]}" "${BRANCHES_D}" "${APP_DIR}" &&
21 cd "${APP_DIR}" &&
22 "$@"
24 cd / &&
25 fusermount -u "${APP_DIR}" &&
26 rmdir "${APP_DIR}"
29 tiefighter.firstRun() {
30 "${__firstRun}"