-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
48 lines (39 loc) · 1.25 KB
/
Copy pathtest.sh
File metadata and controls
48 lines (39 loc) · 1.25 KB
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
#!/bin/bash
source env.sh
# Make sure you run build.sh beforehand !!!
if [ ! -f "$SYS/ut-bin" ]; then
echo "UT binary not found at $SYS/ut-bin"
exit 1
fi
if [ ! -d "$BUILD_DIR" ] && [ "$1" != "-no-build" ]; then
echo "Build directory is empty! If this wasn't a mistake, run with \"-no-build\" to skip the build step."
exit 1
fi
# Copy the build files to the System directory
echo "Copying build files to $SYS..."
for F in "$BUILD_DIR"/*; do
printf "\033[0;37m"
cp -v "$F" "$SYS"
done
printf "\033[0m\n"
# Kill any running instances of ut-bin and start the game
echo "Killing other ut-bin instances..."
printf "\033[0;37m"
killall ut-bin
printf "\033[0m\n"
printf "Running Unreal Tournament\n"
# The game doesn't have a console, spawn one that reads UnrealTournament.log live as it updates
# TERMINNAL can be omitted to hide the window altogether
"$TERMINAL" sh -c "watch -n 0.1 tac $(realpath "$UT_LOG")" &
"$SYS/ut-bin" -nohomedir
# Once the game is closed, delete the copied files to keep the game installation clean
printf "\nDeleting build files from %s...\n" "$SYS"
for F in "$BUILD_DIR"/*; do
printf "\033[0;37m"
rm -v "$SYS/$(basename "$F")"
printf "\033[0m"
done
# Stop the term emulator
echo "Killing terminal emulator at PID $!"
kill $!
exit 0