-
Notifications
You must be signed in to change notification settings - Fork 3
/
update-mw-extensions.sh
executable file
·61 lines (55 loc) · 1.98 KB
/
update-mw-extensions.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
#########################################################################
#Name: update-mw-extensions.sh
#Subscription: Updates all MediaWiki extensions which are installed via GIT
# It can also be used with a docker compose project.
##by A. Laub
#andreas[-at-]laub-home.de
#
#License:
#This program is free software: you can redistribute it and/or modify it
#under the terms of the GNU General Public License as published by the
#Free Software Foundation, either version 3 of the License, or (at your option)
#any later version.
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
#or FITNESS FOR A PARTICULAR PURPOSE.
#########################################################################
#Set the language
export LANG="en_US.UTF-8"
#Load the Pathes
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# set the variables
# Automatically Restart the compose Project after Upgrade?
# true or false
RESTART=false
# where to find compose Project
#COMPOSEPROJECT=/opt/laubhome_135
COMPOSEPROJECT=$(pwd)
# where to find the extensions outgoing of the script Path
EXTENSIONSDIR=$COMPOSEPROJECT/data/extensions
# where to find the skins outgoing of the script Path
SKINSDIR=$COMPOSEPROJECT/data/skins
### Do the stuff
for i in $(ls $EXTENSIONSDIR); do
if [ -d $EXTENSIONSDIR/$i/.git ]; then
echo -e "\n$i ist ein GIT Repository:"
# cd $EXTENSIONSDIR/$i && git pull
git -C $EXTENSIONSDIR/$i pull
fi
done
for i in $(ls $SKINSDIR); do
if [ -d $SKINSDIR/$i/.git ]; then
echo -e "\n$i ist ein GIT Repository:"
# cd $SKINSDIR/$i && git pull
git -C $SKINSDIR/$i pull
fi
done
# At the End restart of the compose project
if [ $RESTART = true ]; then
echo -e "\nRestarting the compose project!"
cd $COMPOSEPROJECT
docker-compose restart
elif [ $RESTART = false ]; then
echo -e "\nDon't restarting the compose project!"
fi