#!/bin/sh +x os=$(cat "$__global/explorer/os") os_version=$(cat "$__global/explorer/os_version") # remove this check, if there is support for othere OS if [ ! "$os" = "debian" ]; then echo "OS $os is currently not supported." >&2 exit 1 fi case "$os" in centos) restart="/etc/init.d/nginx reload" ;; debian) case "$os_version" in [1-7]*) restart="/etc/init.d/nginx restart" echo "Unsupported version $os_version of $os." >&2 exit 1 ;; 8*) restart="systemctl restart nginx" ;; *) restart="systemctl restart nginx" echo "Unsupported version $os_version of $os." >&2 exit 1 ;; esac ;; devuan) restart="/etc/init.d/nginx restart" ;; *) echo "Unsupported OS: $os" >&2 exit 1 ;; esac # maybe we dont need this if grep -E -q "^(__file|__link)/etc/nginx" "$__messages_in"; then echo $restart fi 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") domain=$(cat "$__object/parameter/domain") # TODO check shasum of tar ball # INSTALL_STATE="$([ -d /var/www/nextcloud ] && cd /var/www/nextcloud && sudo -u www-data php occ status| grep -o true)" # if [ ! "\$INSTALL_STATE" ] || [ ! -z "\$INSTALL_STATE" ]; then cat <