From 0479c9beda9dee9e8501f8ff3b989f2fffa1110e Mon Sep 17 00:00:00 2001 From: Joulinar <47155374+Joulinar@users.noreply.github.com> Date: Thu, 22 Jun 2023 13:13:56 +0200 Subject: [PATCH] v8.19 DietPi-Software | MediaWiki - adjust the way fetching current version. Co-authored-by: MichaIng --- dietpi/dietpi-software | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index fc75ff2ef3..db289bf247 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -11678,18 +11678,15 @@ _EOF_ fi # Get latest version - local version='1.39.3' - Download_Install "https://releases.wikimedia.org/mediawiki/${version%.*}/mediawiki-$version.tar.gz" + local fallback_url='https://releases.wikimedia.org/mediawiki/1.39/mediawiki-1.39.3.tar.gz' + Download_Install "$(curl -sSfL 'https://www.mediawiki.org/wiki/Download' | grep -o 'https://releases\.wikimedia\.org/mediawiki/[^/"]*/mediawiki-[^"]*\.tar\.gz' | head -1)" # Reinstall: Clean install but preserve existing config file - [[ -f '/var/www/wiki/LocalSettings.php' ]] && G_EXEC mv /var/www/wiki/LocalSettings.php "mediawiki-$version/" + [[ -f '/var/www/wiki/LocalSettings.php' ]] && G_EXEC mv /var/www/wiki/LocalSettings.php mediawiki-*/ [[ -d '/var/www/wiki' ]] && G_EXEC rm -R /var/www/wiki # Move new instance in place - G_EXEC cp -a "mediawiki-$version/." /var/www/wiki/ - G_EXEC rm -R "mediawiki-$version" - - unset -v version + G_EXEC mv mediawiki-* /var/www/wiki # Permissions G_EXEC chown -R www-data:www-data /var/www/wiki