summarylogtreecommitdiffstats
path: root/gog-dragonsphere
diff options
context:
space:
mode:
authorDan Beste2017-02-02 22:03:34 -0600
committerDan Beste2017-02-02 22:03:34 -0600
commitfed2e4c4232b7977f9d685dd010941b8bb27baed (patch)
tree6ee0cb0c76a5779827677ada3cd09c0d918bda6f /gog-dragonsphere
parent75fa595eb2b7e246dd36167c4f6fe4a931b3a1f5 (diff)
downloadaur-fed2e4c4232b7977f9d685dd010941b8bb27baed.tar.gz
Update scripts
Diffstat (limited to 'gog-dragonsphere')
-rw-r--r--gog-dragonsphere33
1 files changed, 22 insertions, 11 deletions
diff --git a/gog-dragonsphere b/gog-dragonsphere
index be8900870a16..0446d066db8a 100644
--- a/gog-dragonsphere
+++ b/gog-dragonsphere
@@ -1,13 +1,24 @@
-#!/usr/bin/bash
-gogdir="/opt/gog/dragonsphere"
-homedir="$HOME/.gog/dragonsphere"
-mkdir -p "$homedir"/{game,config/data/DRAGON}
+#! /bin/bash
-if [[ ! -e "$homedir/config/dosboxDragonsphere.conf" ]]; then
- cp "$gogdir/dosboxDragonsphere.conf" "$homedir/config/dosboxDragonsphere.conf"
-fi
-
-unionfs "$homedir/config=RW:$gogdir=RO" "$homedir/game"
-"$homedir"/game/start.sh
-fusermount -u "$homedir/game"
+pkgname="gog-dragonsphere"
+pkgdir="/opt/${pkgname}/"
+run="${pkgdir}/start.sh"
+if hash firejail; then
+ echo "Firejail detected; attempting to enforce a sandbox..."
+ if [[ -f "${XDG_CONFIG_HOME}/firejail/${pkgname}.profile" ]]; then
+ echo "Firejail profile for ${pkgname} found in ${XDG_CONFIG_HOME}/firejail/"
+ echo "Enforcing a sandbox!"
+ firejail "${run}"
+ elif [[ -f "/etc/firejail/${pkgname}.profile" ]]; then
+ echo "Firejail profile for ${pkgname} found in /etc/firejail/"
+ echo "Enforcing a sandbox!"
+ firejail "${run}"
+ else
+ echo "No Firejail profile detected!"
+ echo "Skipping Firejail sandbox..."
+ "${run}"
+ fi
+else
+ "${run}"
+fi