prepering this type for combination with __ungleich_nginx_app_proxy

This commit is contained in:
moep 2017-08-02 15:09:58 +02:00
parent d6b0272b22
commit c34c202a9c
2 changed files with 19 additions and 18 deletions

View file

@ -1,21 +1,13 @@
#!/bin/sh #!/bin/sh +x
os=$(cat "$__global/explorer/os") os=$(cat "$__global/explorer/os")
if [ ! "$os" = "debian" ] os_version=$(cat "$__global/explorer/os_version")
then
# remove this check, if there is support for othere OS
if [ ! "$os" = "debian" ]; then
echo "OS $os is currently not supported." >&2 echo "OS $os is currently not supported." >&2
exit 1 exit 1
fi fi
os_version=$(cat "$__global/explorer/os_version")
case "$os_version" in
8*)
:
;;
*)
echo "Unsupported version $os_version of $os." >&2
exit 1
;;
esac
case "$os" in case "$os" in
centos) centos)
@ -25,9 +17,16 @@ case "$os" in
case "$os_version" in case "$os_version" in
[1-7]*) [1-7]*)
restart="/etc/init.d/nginx restart" 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" restart="systemctl restart nginx"
echo "Unsupported version $os_version of $os." >&2
exit 1
;; ;;
esac esac
;; ;;
@ -40,6 +39,7 @@ case "$os" in
;; ;;
esac esac
# maybe we dont need this
if grep -E -q "^(__file|__link)/etc/nginx" "$__messages_in"; then if grep -E -q "^(__file|__link)/etc/nginx" "$__messages_in"; then
echo $restart echo $restart
fi fi
@ -53,17 +53,17 @@ admin_pass=$(cat "$__object/parameter/admin-pass")
domain=$(cat "$__object/parameter/domain") domain=$(cat "$__object/parameter/domain")
# TODO check shasum of tar ball # 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 <<eof cat <<eof
INSTALL_STATE="$([ -d /var/www/nextcloud ] && cd /var/www/nextcloud && sudo -u www-data php occ status| grep -o true)" INSTALL_STATE=\$([ -d /var/www/nextcloud ] && cd /var/www/nextcloud && sudo -u www-data php occ status| grep -o true)
if [ ! "$INSTALL_STATE" ] ; then if [ "\$INSTALL_STATE" != "true" ]; then
curl -s -L ${nextcloud_uri} -o /tmp/nextcloud.tar.bz2 curl -s -L ${nextcloud_uri} -o /tmp/nextcloud.tar.bz2
tar -C /var/www -xvjf /tmp/nextcloud.tar.bz2 tar -C /var/www -xvjf /tmp/nextcloud.tar.bz2
rm -f /tmp/nextcloud.tar.bz2 rm -f /tmp/nextcloud.tar.bz2
chown -R www-data:www-data /var/www/nextcloud chown -R www-data:www-data /var/www/nextcloud
cd /var/www/nextcloud cd /var/www/nextcloud
sudo -u www-data php occ maintenance:install --database \ 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"
"pgsql" --database-name "$db_name" --database-user "$db_user" --database-pass \
$db_pass" --admin-user "$admin_user" --admin-pass "$admin_pass"
sudo -u www-data php occ config:system:set trusted_domains 2 --value="$domain" sudo -u www-data php occ config:system:set trusted_domains 2 --value="$domain"
fi fi
eof eof

View file

@ -0,0 +1 @@
domain