Skip to content

Commit

Permalink
Fix seagl-setup-app crashing with no args
Browse files Browse the repository at this point in the history
  • Loading branch information
strugee committed Oct 13, 2024
1 parent b698a0c commit 08818db
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions bin/seagl-setup-app
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
set -euo pipefail
set -x

# XXX this doesn't work if the user actually *explicitly* passes empty string, i.e.
# seagl-setup-app ''
arg="${1-empty string}"

if [ $(id -u) == 0 ]; then
echo fatal: cannot be run as root >&2
exit 1
Expand All @@ -19,15 +23,15 @@ function start_and_link_app() {
nohup gio launch $desktop_file_full >/dev/null 2>&1
}

if [ $1 == obs ]; then
if [ "$arg" == obs ]; then
# TODO provision RTMP keys
start_and_link_app com.obsproject.Studio
elif [ $1 == nextcloud ]; then
elif [ "$arg" == nextcloud ]; then
nextcloud --userid 2024laptops --apppassword "$(jq .nextcloudAppPassword < /var/lib/seagl/config-data.json)" --isvfsenabled 0 --serverurl 'https://cloud.seagl.org/'
start_and_link_app com.nextcloud.desktopclient.nextcloud
elif [ $1 == firefox ]; then
elif [ "$arg" == firefox ]; then
sudo sed -i "s;AV_TEST_RESULTS_PLACEHOLDER;$(jq .avTestResultsSheetURL < /var/lib/seagl/config-data.json);" /etc/firefox/policies/policies.json
start_and_link_app org.mozilla.firefox
else
echo fatal: application to be set up must be one of obs, nextcloud, firefox
echo fatal: application to be set up must be one of obs, nextcloud, firefox, but received $arg
fi

0 comments on commit 08818db

Please sign in to comment.