__ungleich_nextcloud/gencode-remote

37 lines
1.1 KiB
Text
Raw Normal View History

2017-04-21 04:57:03 +00:00
#!/bin/sh
os=$(cat "$__global/explorer/os")
if [ ! "$os" = "debian" ]
then
echo "OS $os is currently not supported." >&2
exit 1
fi
os_version=$(cat "$__global/explorer/os_version")
case "$os_version" in
8*)
:
;;
*)
echo "Unsupported version $os_version of $os." >&2
exit 1
;;
esac
nextcloud_uri="$(cat "$__object/parameter/uri")-$(cat "$__object/parameter/version").tar.bz2"
db_name=$(cat "$__object/parameter/db-name")
db_user=$(cat "$__object/parameter/db-user")
db_pass=$(cat "$__object/parameter/db-pass")
admin_user=$(cat "$__object/parameter/admin-user")
admin_pass=$(cat "$__object/parameter/admin-pass")
2017-04-25 09:42:03 +00:00
# TODO check shasum of tar ball
cat <<eof
2017-05-01 16:24:41 +00:00
curl -s -L ${nextcloud_uri} -o /tmp/nextcloud.tar.bz2
tar -C /var/www -xvjf /tmp/nextcloud.tar.bz2
rm -f /tmp/nextcloud.tar.bz2
chown -R www-data:www-data /var/www/nextcloud
2017-05-01 16:24:41 +00:00
cd /var/www/nextcloud
sudo -u www-data php occ maintenance:install --database \
"pgsql" --database-name "$db_name" --database-user "$db_user" --database-pass \
"$db_pass" --admin-user "$admin_user" --admin-pass "$admin_pass"
2017-04-25 09:42:03 +00:00
eof