-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathupdater.sh
executable file
·73 lines (62 loc) · 1.92 KB
/
updater.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
# TekBase - server control panel
# Copyright since 2005 TekLab
# Christian Frankenstein
# Website: teklab.de
# teklab.net
VAR_A=$1
VAR_B=$2
VAR_C=$3
VAR_D=$4
VAR_E=$5
LOGFILE=$(date +"%Y-%m")
LOGDIR="logs"
DATADIR=$(pwd)
if [ ! -d $LOGDIR ]; then
mkdir $LOGDIR
chmod 755 $LOGDIR
echo "$(date) - INFO: The logs folder has just been created!" >> $LOGDIR/$LOGFILE-update.log
fi
if [ ! -f version.tek ]; then
echo "0" > version.tek
echo "$(date) - INFO: File version.tek has just been created!" >> $LOGDIR/$LOGFILE-update.log
fi
if [ "$VAR_A" == "file" ]; then
wget $VAR_B/$VAR_C.tar
if [ -f $VAR_C.tar ]; then
tar -xf $VAR_C.tar
rm -r $VAR_C.tar
echo "$(date) - INFO: The file has been downloaded and extracted!" >> $LOGDIR/$LOGFILE-update.log
else
echo "$(date) - ERROR: The file could not be downloaded!" >> $LOGDIR/$LOGFILE-update.log
fi
fi
if [ "$VAR_A" == "steam" ]; then
wget http://media.steampowered.com/client/steamcmd_linux.tar.gz
if [ -f steamcmd_linux.tar.gz ]; then
tar -xzf steamcmd_linux.tar.gz
chmod 777 steamcmd.sh
chmod -R 777 linux32
if [ "$VAR_D" != "" ] && [ "$VAR_E" != "" ]; then
./steamcmd.sh +login "$VAR_D" "$VAR_E" +force_install_dir ./$VAR_C +app_update $VAR_B validate +exit
else
./steamcmd.sh +login anonymous +force_install_dir ./$VAR_C +app_update $VAR_B validate +exit
fi
rm steamcmd_linux.tar.gz
rm steamcmd.sh
rm steam.sh
rm -r linux32
echo "$(date) - INFO: The file has been downloaded and extracted!" >> $LOGDIR/$LOGFILE-update.log
else
echo "$(date) - ERROR: The file could not be downloaded!" >> $LOGDIR/$LOGFILE-update.log
fi
fi
if [ "$VAR_A" == "www" ]; then
if [ -d "update_www/$VAR_B" ]; then
$DATADIR/update_www/$VAR_B/updater.sh $DATADIR
cd $DATADIR
fi
fi
rm -r update_www
rm updater.sh
exit 0