-
Notifications
You must be signed in to change notification settings - Fork 0
/
newMap.sh
43 lines (35 loc) · 1.33 KB
/
newMap.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
#!/bin/bash
set -euo pipefail
if [ ! -w mapsettings.json ]; then
cat > mapsettings.json <<- EOM
{
"_comment": "Sizes can be specified as none, very-low, low, normal, high, very-high",
"terrain_segmentation": "normal",
"water": "normal",
"width": 0,
"height": 0,
"starting_area": "high",
"peaceful_mode": false,
"autoplace_controls":
{
"coal": {"frequency": "very-low", "size": "high", "richness": "very-high"},
"copper-ore": {"frequency": "very-low", "size": "high", "richness": "very-high"},
"crude-oil": {"frequency": "very-low", "size": "high", "richness": "very-high"},
"enemy-base": {"frequency": "low", "size": "very-high", "richness": "very-high"},
"iron-ore": {"frequency": "very-low", "size": "high", "richness": "very-high"},
"stone": {"frequency": "very-low", "size": "high", "richness": "very-high"}
}
}
EOM
fi
mkdir -p /opt/modpackFactorissimo/saves
if [ -d factorissimoSave -a ! -h factorissimoSave ]; then
echo "... migrating save directory";
mv factorissimoSave/* /opt/modpackFactorissimo/saves/
rm -rf factorissimoSave/
fi
if [ ! -w factorissimoSave ]; then
echo "... making symbolic link"
ln -s /opt/modpackFactorissimo/saves factorissimoSave
fi
/opt/modpackFactorissimo/bin/x64/factorio --create /opt/modpackFactorissimo/saves/$(date +%Y%m%d) --map-gen-settings mapsettings.json