nc-init.sh: Fix ncp theming

Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
This commit is contained in:
Tobias Knöppler 2023-03-28 15:39:16 +02:00
parent 378df3bd5c
commit f10c48d1c0
No known key found for this signature in database
GPG Key ID: 3510056072886A8F
2 changed files with 20 additions and 6 deletions

View File

@ -114,15 +114,16 @@ EOF
ncc config:system:set mail_from_address --value="admin"
ncc config:system:set mail_domain --value="ownyourbits.com"
# NCP theme
# Fix NCP theme
[[ -e /usr/local/etc/logo ]] && {
local ID=$( grep instanceid config/config.php | awk -F "=> " '{ print $2 }' | sed "s|[,']||g" )
[[ "$ID" == "" ]] && { echo "failed to get ID"; return 1; }
mkdir -p data/appdata_${ID}/theming/images
cp /usr/local/etc/background data/appdata_${ID}/theming/images
cp /usr/local/etc/logo data/appdata_${ID}/theming/images/logo
cp /usr/local/etc/logo data/appdata_${ID}/theming/images/logoheader
chown -R www-data:www-data data/appdata_${ID}
local theming_base_path="data/appdata_${ID}/theming/global/images"
mkdir -p "${theming_base_path}"
cp /usr/local/etc/background "${theming_base_path}/"
cp /usr/local/etc/logo "${theming_base_path}/logo"
cp /usr/local/etc/logo "${theming_base_path}/logoheader"
chown -R www-data:www-data "data/appdata_${ID}"
}
mysql nextcloud <<EOF

13
updates/1.52.0.sh Normal file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
# Fix NCP theme
[[ -e /usr/local/etc/logo ]] && {
ID=$( grep instanceid config/config.php | awk -F "=> " '{ print $2 }' | sed "s|[,']||g" )
[[ "$ID" == "" ]] && { echo "failed to get ID"; return 1; }
theming_base_path="data/appdata_${ID}/theming/global/images"
mkdir -p "${theming_base_path}"
[ -f "${theming_base_path}/background" ] || cp /usr/local/etc/background "${theming_base_path}/background"
[ -f "${theming_base_path}/logo" ] || cp /usr/local/etc/logo "${theming_base_path}/logo"
[ -f "${theming_base_path}/logoheader" ] || cp /usr/local/etc/logo "${theming_base_path}/logoheader"
chown -R www-data:www-data "data/appdata_${ID}"
}