-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
70 lines (64 loc) · 1.84 KB
/
install.sh
File metadata and controls
70 lines (64 loc) · 1.84 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
68
69
70
#!/usr/bin/env bash
if [ -z ${1+x} ]; then
echo -e "Usage: $0 <gdps_id> [plan]\nPlans: press_start (default), continue, boss_fight, final_stage"
exit
fi
gdps_id=$1
gdps_pass=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 12 | head -n 1)"*"
sudo apt install php php-fpm php-curl php-mysql
rm DOCS.md README.md
echo "Making DB..."
mysql -e "CREATE USER 'halgd_${gdps_id}'@'localhost' IDENTIFIED BY '${gdps_pass}';"
mysql -e "CREATE DATABASE gdps_${gdps_id};"
mysql -e "GRANT ALL PRIVILEGES ON gdps_${gdps_id}.* TO 'halgd_${gdps_id}'@'localhost';"
mysql gdps_${gdps_id} < database.sql
rm database.sql
if [ -z ${2+x} ]; then
gdps_plan="press_start"
else
gdps_plan=$2
fi
echo "Making Config... [${gdps_plan}]"
if [ $2 == "press_start" ]; then
c_umax=110
c_lvlmax=500
c_commmax=1000
c_postmax=250
elif [ $2 == "continue" ]; then
c_umax=550
c_lvlmax=2000
c_commmax=20000
c_postmax=2000
elif [ $2 == "boss_fight" ]; then
c_umax=2200
c_lvlmax=4000
c_commmax=50000
c_postmax=10000
elif [ $2 == "final_stage" ]; then
c_umax=1000000
c_lvlmax=1000000
c_commmax=3000000
c_postmax=5000000
else
c_umax=550
c_lvlmax=2000
c_commmax=20000
c_postmax=2000
fi
sed -i -e "s/C_UMAX/${c_umax}/g" conf/limits.php
sed -i -e "s/C_LVLMAX/${c_lvlmax}/g" conf/limits.php
sed -i -e "s/C_COMMMAX/${c_commmax}/g" conf/limits.php
sed -i -e "s/C_POSTMAX/${c_postmax}/g" conf/limits.php
echo "Makeing DB Config..."
sed -i -e "s/XDB_USERX/halgd_${gdps_id}/g" conf/dbconfig.php
sed -i -e "s/XDB_PASSX/${gdps_pass}/g" conf/dbconfig.php
sed -i -e "s/XDB_NAMEX/gdps_${gdps_id}/g" conf/dbconfig.php
echo "Making paths..."
mkdir -p files/savedata
touch files/ban_ip.txt
touch files/log.html
chown -R www-data:www-data .
git update-index --skip-worktree conf/
git update-index --skip-worktree files/
echo -e "DB Info:\n\tLogin: halgd_${gdps_id}\n\tPass: ${gdps_pass}"
rm install.sh