Skip to content

Commit

Permalink
v8.19
Browse files Browse the repository at this point in the history
DietPi-Software | MediaWiki - adjust the way fetching current version.

Co-authored-by: MichaIng <[email protected]>
  • Loading branch information
Joulinar and MichaIng authored Jun 22, 2023
1 parent 1eab904 commit 0479c9b
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0479c9b

Please sign in to comment.