forked from Lexxie9952/fcw.org-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
scenario-build.sh
50 lines (41 loc) · 2.26 KB
/
scenario-build.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
#!/bin/bash
# refreshes the listed SCENARIOS, gzips them, then copies to all necessary locations
# NOTE: assumes /home/freeciv/freeciv-web/freeciv/freeciv/data/scenarios/ is location for update source
# scenario_name.sav files are located in:
#########################################
# /home/freeciv/freeciv-web/freeciv/freeciv/data/scenarios
# /var/lib/tomcat8/webapps/data/savegames
# scenario_name.sav.gz files are located in:
############################################
# /home/freeciv/freeciv/share/freeciv/scenarios
# /home/freeciv/freeciv-web/freeciv/build/data/scenarios
SCENARIOS=(europe.sav europe-new-positions.sav)
TOPDIR="$( cd ../"$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"
printf "\n./scenario-build.sh: DEPLOYED VERSION. Use ./vscenario-build.sh for vagrant servers.\n"
printf "\n****************************************************************************\n"
printf "This refreshes only the SCENARIOS marked for rebuild inside this script.\n"
printf "****************************************************************************\n"
SCENARIOS=(europe.sav europe-new-positions.sav tutorial.sav)
TOPDIR="$( cd ../"$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"
printf "\nUpdating scenarios...\n"
printf "***********************\n"
for r in ${SCENARIOS[@]}; do
echo "$r"
echo " copying to /var/lib/tomcat8/webapps/data/savegames"
cp /home/freeciv/freeciv-web/freeciv/freeciv/data/scenarios/$r /var/lib/tomcat8/webapps/data/savegames
echo " copying to /home/freeciv/freeciv-web/freeciv/build/data/scenarios"
cp /home/freeciv/freeciv-web/freeciv/freeciv/data/scenarios/$r /home/freeciv/freeciv-web/freeciv/build/data/scenarios
printf "\n"
done
printf "\nGZIP scenarios and copy...\n"
cd /home/freeciv/freeciv-web/freeciv/build/data/scenarios
for r in ${SCENARIOS[@]}; do
echo "$r"
echo " GZIP /home/freeciv/freeciv-web/freeciv/build/data/scenarios/$r"
gzip $r
echo " copying $r.sav.gz to /home/freeciv/freeciv/share/freeciv/scenarios"
cp $r.gz /home/freeciv/freeciv/share/freeciv/scenarios
printf "\n"
done
printf "\n****** REMINDER: ************************************************************\n"
printf "(1) run ./build.sh to refresh and activate the new manuals.\n"