-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathupdate.sh
More file actions
67 lines (54 loc) · 1.78 KB
/
update.sh
File metadata and controls
67 lines (54 loc) · 1.78 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/sh
# Obsolete file, replaced by update_scripts.sh - Only here for backwards compatibility
directory=$(cat ~/.nquakesv/install_dir)
nqecho() {
nqnecho "$* \n"
}
nqnecho() {
[ -z "${quiet}" ] && printf "$*"
}
nqeecho() {
[ -z "${extraquiet}" ] && printf "$*"
}
nqiecho() {
[ -z "${noninteractive}" ] && nqecho $*
}
nqwget() {
[ -n "${quiet}" ] && {
wget -q $* >/dev/null 2>&1
} || {
wget $*
}
}
githubdl() {
localpath=$1
remotepath=$2
nqwget -q -O ${localpath} https://raw.githubusercontent.com/nQuake/server-linux/master/${remotepath}
chmod +x ${localpath}
}
githubd2() {
localpath=$1
remotepath=$2
nqwget -q -O ${localpath} https://raw.githubusercontent.com/ciscon/random/master/${remotepath}
chmod +x ${localpath}
}
nqnecho "* Downloading shell scripts..."
(githubdl ${directory}/start_servers.sh scripts/start_servers.sh && \
githubdl ${directory}/stop_servers.sh scripts/stop_servers.sh && \
githubdl ${directory}/update_scripts.sh scripts/update_scripts.sh && \
githubdl ${directory}/update_binaries.sh scripts/update_binaries.sh && \
githubdl ${directory}/update_configs.sh scripts/update_configs.sh && \
githubdl ${directory}/update_maps.sh scripts/update_maps.sh && \
githubd2 ${directory}/nquakesv-build-mvdsv.sh quake-scripts/build/nquakesv-build-mvdsv.sh && \
githubd2 ${directory}/nquakesv-build-ktx.sh quake-scripts/build/nquakesv-build-ktx.sh && echo done) || nqecho fail
nqecho
# Convert DOS files to UNIX
nqnecho "* Converting DOS files to UNIX..."
for file in $(find ${directory} -iname "*.sh"); do
[ -f "${file}" ] && sed -i 's/\r$//' ${file}
done
nqecho "done"
nqecho "IMPORTANT: update.sh has been replaced by update_scripts.sh"
nqecho "You can delete update.sh"
nqecho
exit 0