diff options
author | Dan Beste | 2017-01-28 13:03:41 -0600 |
---|---|---|
committer | Dan Beste | 2017-01-28 13:03:41 -0600 |
commit | c39f429efda590f7d38174fab23ecb51c5eac3ee (patch) | |
tree | eb3d59375ff6f0087720714a46fb2199d6bfc0d2 /gog-owlboy | |
parent | 73d97ef942c9bf125451e784b4c70ab586cdba43 (diff) | |
download | aur-c39f429efda590f7d38174fab23ecb51c5eac3ee.tar.gz |
Cleanup
Clean PKGBUILD
Refactor gog-owlboy script
Diffstat (limited to 'gog-owlboy')
-rwxr-xr-x[-rw-r--r--] | gog-owlboy | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/gog-owlboy b/gog-owlboy index 0e19fcd06d89..4642d87e61b0 100644..100755 --- a/gog-owlboy +++ b/gog-owlboy @@ -1,13 +1,24 @@ -#! /bin/sh +#! /bin/bash -run="/opt/gog-owlboy/start.sh" -# The launcher fails unless in its dir. -cd /opt/gog-undertale/ || exit 1 +pkgname="gog-owlboy" +pkgdir="/opt/${pkgname}/" +run="${pkgdir}/start.sh" -if which firejail >/dev/null 2>&1 && [ -z "$FIREJAIL_IGNORE" ]; then - echo "Firejail detected. Enforcing a sandbox" - echo "To bypass Firejail enforcement, run FIREJAIL_IGNORE=1 $run." - firejail --caps.drop=all "$run" +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" + "${run}" fi |