-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add DSM 6 wizard checks for multiple PHP profiles
- Loading branch information
Showing
4 changed files
with
103 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
|
||
quote_json () | ||
{ | ||
sed -e 's|\\|\\\\|g' -e 's|\"|\\\"|g' | ||
} | ||
|
||
page_append () | ||
{ | ||
if [ -z "$1" ]; then | ||
echo "$2" | ||
elif [ -z "$2" ]; then | ||
echo "$1" | ||
else | ||
echo "$1,$2" | ||
fi | ||
} | ||
|
||
# Check for multiple PHP profiles | ||
check_php_profiles () | ||
{ | ||
PHP_CFG_PATH="/usr/syno/etc/packages/WebStation/PHPSettings.json" | ||
if [ "${SYNOPKG_DSM_VERSION_MAJOR}" -lt 7 ]; then | ||
if jq -e 'to_entries | map(select((.key | startswith("com-synocommunity-packages-")) and .key != "com-synocommunity-packages-selfoss")) | length > 0' "${PHP_CFG_PATH}" >/dev/null; then | ||
return 0 # true | ||
else | ||
return 1 # false | ||
fi | ||
fi | ||
} | ||
|
||
PAGE_PHP_PROFILES=$(/bin/cat<<EOF | ||
{ | ||
"step_title": "Multiple PHP profiles", | ||
"items": [{ | ||
"desc": "Attention: Multiple PHP profiles detected; the package webpage will not display until a DSM restart is performed to load new configurations." | ||
}] | ||
} | ||
EOF | ||
) | ||
|
||
main () { | ||
local install_page="" | ||
if check_php_profiles; then | ||
install_page=$(page_append "$install_page" "$PAGE_PHP_PROFILES") | ||
fi | ||
echo "[$install_page]" > "${SYNOPKG_TEMP_LOGFILE}" | ||
} | ||
|
||
main "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
|
||
quote_json () | ||
{ | ||
sed -e 's|\\|\\\\|g' -e 's|\"|\\\"|g' | ||
} | ||
|
||
page_append () | ||
{ | ||
if [ -z "$1" ]; then | ||
echo "$2" | ||
elif [ -z "$2" ]; then | ||
echo "$1" | ||
else | ||
echo "$1,$2" | ||
fi | ||
} | ||
|
||
# Check for multiple PHP profiles | ||
check_php_profiles () | ||
{ | ||
PHP_CFG_PATH="/usr/syno/etc/packages/WebStation/PHPSettings.json" | ||
if [ "${SYNOPKG_DSM_VERSION_MAJOR}" -lt 7 ]; then | ||
if jq -e 'to_entries | map(select((.key | startswith("com-synocommunity-packages-")) and .key != "com-synocommunity-packages-selfoss")) | length > 0' "${PHP_CFG_PATH}" >/dev/null; then | ||
return 0 # true | ||
else | ||
return 1 # false | ||
fi | ||
fi | ||
} | ||
|
||
PAGE_PHP_PROFILES=$(/bin/cat<<EOF | ||
{ | ||
"step_title": "Plusieurs profils PHP", | ||
"items": [{ | ||
"desc": "Attention : Plusieurs profils PHP détectés ; la page Web du package ne s'affichera pas tant qu'un redémarrage de DSM n'aura pas été effectué pour charger de nouvelles configurations." | ||
}] | ||
} | ||
EOF | ||
) | ||
|
||
main () { | ||
local install_page="" | ||
if check_php_profiles; then | ||
install_page=$(page_append "$install_page" "$PAGE_PHP_PROFILES") | ||
fi | ||
echo "[$install_page]" > "${SYNOPKG_TEMP_LOGFILE}" | ||
} | ||
|
||
main "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
[{ | ||
"step_title": "Remove selfoss database", | ||
"items": [{ | ||
"desc": "Attention: The selfoss database will be removed during package uninstallation. All feeds will be deleted." | ||
}, { | ||
"desc": "Optional: Use the 'Export sources' function within 'Settings' to keep a backup of your feeds." | ||
"desc": "Attention: The selfoss database will be deleted when uninstalling the package, resulting in the removal of all feeds. Optionally, safeguard your feeds by utilizing the 'Export sources' function in the 'Settings' menu to create a backup." | ||
}] | ||
}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
[{ | ||
"step_title": "Suppression de la base de donnée selfoss", | ||
"step_title": "Supprimer la base de données Selfoss", | ||
"items": [{ | ||
"desc": "Si vous supprimez la base de donnée selfoss, tous les flux seront supprimées." | ||
}, { | ||
"desc": "Facultatif: Utilisez la fonction « Exporter les sources » dans « Paramètres » pour conserver une sauvegarde de vos flux." | ||
"desc": "Attention : La base de données selfoss sera supprimée lors de la désinstallation du package, entraînant la suppression de tous les flux. Vous pouvez éventuellement sauvegarder vos flux en utilisant la fonction « Exporter les sources » dans le menu « Paramètres » pour créer une sauvegarde." | ||
}] | ||
}] |