-
Notifications
You must be signed in to change notification settings - Fork 0
/
cmp_upload.sh
40 lines (33 loc) · 1.28 KB
/
cmp_upload.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
#!/bin/bash
GREEN='\033[1;32m'
NC='\033[0m'
# Check if the first argument is provided
if [ -z "$1" ]; then
echo "Please provide a new filename as the first argument."
exit 1
fi
# Check if the second argument is provided and is true
if [ -z "$2" ]; then
echo "Please provide a second argument."
exit 1
elif [ "$2" = true ]; then
uploadGameInterface=true
echo "The second argument is true."
else
uploadGameInterface=false
echo "The second argument is not true."
fi
echo -e "${GREEN}Starting compilation...${NC}"
cmd.exe "/mnt/c/t7compiler/DebugCompiler.exe --compile" || exit 1
echo -e "${GREEN}GSC file compiled successfully.${NC}"
# Rename the file
mv --force compiled.gscc "$1" || exit 1
echo -e "${GREEN}GSC file renamed to $1.${NC}"
# Copy the file to the server
scp -i ~/SSH_KEY_FOR_STRATO.pem -r "$1" debian@130.225.37.75:~/UnrankedServer/boiii/scripts/zm/gametypes >/dev/null || exit 1
echo -e "${GREEN}GSC file copied to the server using SCP.${NC}"
# Copy gameinterface to the server
if [ "$uploadGameInterface" = true ]; then
scp -i ~/SSH_KEY_FOR_STRATO.pem -r scripts/game_interface/plugins/GameInterface.js debian@130.225.37.75:~/IW4MAdmin-2024.2.5.6/Plugins >/dev/null || exit 1
echo -e "${GREEN}GameInterface copied to the server using SCP.${NC}"
fi