__ungleich_nextcloud/gencode-remote

60 lines
1.7 KiB
Text
Raw Normal View History

#!/bin/sh
2017-04-21 04:57:03 +00:00
os=$(cat "$__global/explorer/os")
2017-09-17 20:20:16 +00:00
os_version=$(cat "$__global/explorer/os_version")
2017-07-25 14:16:51 +00:00
case "$os" in
centos)
restart="/etc/init.d/nginx reload"
;;
debian)
case "$os_version" in
2020-02-26 10:36:26 +00:00
[2-7]*)
2017-07-25 14:16:51 +00:00
restart="/etc/init.d/nginx restart"
echo "Unsupported version $os_version of $os." >&2
exit 1
;;
2020-02-26 10:36:26 +00:00
[8-9]*)
restart="systemctl restart nginx"
2017-07-25 14:16:51 +00:00
;;
2020-02-26 10:36:26 +00:00
10*)
2017-12-11 20:52:00 +00:00
restart="systemctl restart nginx"
;;
2018-12-05 13:12:00 +00:00
*)
echo "Unsupported version $os_version of $os." >&2
exit 1
2017-07-25 14:16:51 +00:00
;;
esac
;;
devuan)
restart="/etc/init.d/nginx restart"
;;
2017-09-17 20:20:16 +00:00
*)
echo "Unsupported version $os_version of $os." >&2
2017-07-25 14:16:51 +00:00
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-05-02 04:04:59 +00:00
domain=$(cat "$__object/parameter/domain")
2018-12-05 13:12:00 +00:00
# FIXME: replace if we an if on output && an explorer
cat <<eof
2018-12-05 13:12:00 +00:00
if [ ! -e /var/www/nextcloud/occ ]; then
cd /var/www
curl -s -L ${nextcloud_uri} | tar xj
chown -R www-data:www-data /var/www/nextcloud
2017-07-24 16:09:08 +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-07-24 16:09:08 +00:00
sudo -u www-data php occ config:system:set trusted_domains 2 --value="$domain"
2018-12-05 13:12:00 +00:00
else
true
fi
2017-07-24 16:09:08 +00:00
eof