|
6 | 6 | # Website: https://tracker.iguaserver.de
|
7 | 7 |
|
8 | 8 | if whiptail --yesno "Apt Update?" 10 35; then
|
9 |
| - sudo apt update -y |
10 |
| -else |
11 |
| - echo "No update" |
| 9 | + sudo apt-get update -y |
12 | 10 | fi
|
13 |
| -#Check if curl is installed |
14 |
| -if ! command -v curl &> /dev/null |
| 11 | +#Check if git and mysql are installed |
| 12 | +if ! command -v git &> /dev/null |
15 | 13 | then
|
16 |
| - sudo apt-get install curl -y |
17 |
| - exit |
| 14 | + sudo apt-get install git -y |
18 | 15 | fi
|
19 | 16 | if ! command -v mysql &> /dev/null
|
20 | 17 | then
|
21 | 18 | echo "Please install mysql"
|
22 | 19 | exit 0
|
23 | 20 | fi
|
24 |
| -webserver=$(whiptail --separate-output --radiolist --title "Installation" "Select your webserver" 10 60 2 \ |
25 |
| - "Nginx" "Select this if you're running Nginx" ON \ |
26 |
| - "Apache" "Select this if you're running Apache" OFF 3>&1 1>&2 2>&3) |
27 |
| -exitstatus=$? |
28 |
| -[[ "$exitstatus" = 1 ]] && exit 0; |
29 |
| -#Get Project files |
30 |
| -LOCATION=$(curl -s https://api.github.com/repos/AunePVP/Game-Server-Query-and-Control-Center/releases/latest \ |
31 |
| -| grep "zipball_url" \ |
32 |
| -| awk '{ print $2 }' \ |
33 |
| -| sed 's/,$//' \ |
34 |
| -| sed 's/"//g' ) \ |
35 |
| -; curl -L -o download.zip $LOCATION |
36 |
| -unzip download.zip |
37 |
| -rm download.zip |
38 |
| -namedir=$(ls -d */) |
39 |
| -mkdir ${namedir}query/cron |
40 |
| -mkdir ${namedir}query/cron/cache |
41 | 21 | user=$(whoami)
|
42 | 22 | wsuname=$(whiptail --inputbox --title "Installation" "Please enter your webserver username (most likely www-data)" 10 60 3>&1 1>&2 2>&3)
|
43 | 23 | exitstatus=$?
|
44 | 24 | [[ "$exitstatus" = 1 ]] && exit 0;
|
45 |
| -#Set file permissions |
| 25 | +# Download Source code with git |
| 26 | +git clone https://github.com/AunePVP/Game-Server-Query-and-Control-Center |
| 27 | +# Set file permissions |
| 28 | +namedir=Game-Server-Query-and-Control-Center/ |
| 29 | +user=$(whoami) |
46 | 30 | find $namedir -type d -exec chmod 770 {} \;
|
47 | 31 | find $namedir -type f -exec chmod 640 {} \;
|
48 | 32 | find ${namedir}html/type/arkse/ -type f -exec chmod 660 {} \;
|
49 | 33 | sudo chown -R ${user}:${wsuname} $namedir
|
50 |
| -mv ${namedir}/* . |
51 |
| -rm -r $namedir |
| 34 | +sudo mv -f ${namedir}{.,}* . |
| 35 | +sudo rm -r $namedir |
52 | 36 |
|
53 | 37 | mysqlucheck="$(sudo mysql -sse "SELECT EXISTS(SELECT 1 FROM mysql.user WHERE user = '$user')")"
|
54 | 38 | dbname=$(whiptail --inputbox --title "Create Database" "Please enter a name for your database" 10 100 3>&1 1>&2 2>&3)
|
|
0 commit comments