forked from forgecraft/server-configs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsync-to-server.sh
executable file
·41 lines (33 loc) · 901 Bytes
/
sync-to-server.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
#!/usr/bin/env sh
# Check if .tmp exists
if [ -d .tmp ]; then
echo "Removing .tmp"
rm -rf .tmp
fi
# Create .tmp
echo "Creating .tmp"
mkdir .tmp
mv ../1.20.4/config .tmp
mv ../1.20.4/world/serverconfig .tmp
# Remove old files
echo "Removing old files"
rm -rf ../1.20.4/config
rm -rf ../1.20.4/world/serverconfig
# Move new files
echo "Moving new files"
cp -r ./config ../1.20.4/
cp -r ./serverconfig ../1.20.4/world/
# If the ./secrets folder exists, move it to the new server
if [ -d ./secrets ]; then
echo "Moving secrets"
# Test if we have ./secrets/config/
if [ -d ./secrets/config ]; then
echo "Moving ./secrets/config"
cp -r ./secrets/config ../1.20.4/
fi
# Test if we have ./secrets/serverconfig/
if [ -d ./secrets/serverconfig ]; then
echo "Moving ./secrets/serverconfig"
cp -r ./secrets/serverconfig ../1.20.4/world/
fi
fi