Browse Source

fix: [nextcloud] make upgrade from foreign ``config.php`` more solid

bgallet/nextcloud
Valentin Lab 1 month ago
parent
commit
c1963d1331
  1. 3
      nextcloud/hooks/sql_database-relation-joined

3
nextcloud/hooks/sql_database-relation-joined

@ -44,11 +44,12 @@ if [ -e "$CONFIGFILE" ] && grep "^ 'dbuser' => '" "$CONFIGFILE" >/dev/null; the
exit 1 exit 1
;; ;;
esac esac
sed -i 's/\r//' "$CONFIGFILE" ## Remove DOS/WIN carriage returns if any
sed -ri "s/^( 'dbuser' => ')(.*)(',)$/\1${quoted_user}\3/g;\ sed -ri "s/^( 'dbuser' => ')(.*)(',)$/\1${quoted_user}\3/g;\
s/^( 'dbpassword' => ')(.*)(',)$/\1${quoted_password}\3/g;\ s/^( 'dbpassword' => ')(.*)(',)$/\1${quoted_password}\3/g;\
s/^( 'dbtype' => ')(.*)(',)$/\1${nextcloud_type}\3/g;\ s/^( 'dbtype' => ')(.*)(',)$/\1${nextcloud_type}\3/g;\
s/^( 'dbhost' => ')(.*)(',)$/\1${MASTER_TARGET_SERVICE_NAME}\3/g;\ s/^( 'dbhost' => ')(.*)(',)$/\1${MASTER_TARGET_SERVICE_NAME}\3/g;\
s/^( 'dbname' => ')(.*)(',)$/\1${DBNAME}\3/g;\
" "$CONFIGFILE" " "$CONFIGFILE"
else else

Loading…
Cancel
Save