forked from kthxdie/PSMPS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
psmps-install
executable file
·144 lines (90 loc) · 2.82 KB
/
psmps-install
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#!/bin/sh
# CLEAR THE CLI
clear
# CONTINUE ONLY IF ROOT USER!
sUserName=$(whoami)
if [ "$sUserName" != "root" ] ; then
echo ""
echo "PSMPS Start Install Script"
echo ""
echo "You must be a root user to execute this script!"
echo "Please execute 'su' in terminal, enter the root"
echo "password, and execute this script again!"
echo ""
exit 1
fi
#clear all logs
rm -f /var/log/psmps-*
#STAY IN ROOT FOLDER AND USE ABSOLUTE PATHS
cd / > /var/log/psmps-install
echo "PSMP MAIN INSTALL STARTED" >> /var/log/psmps-install
until [ "$sContinue" = "yes" ]
do
if [ "$sContinue" = "quit" ] ; then
echo "PSMP INSTALL ABORTED BY USER (startInstall Script)" >> /var/log/psmps-install
clear
echo ""
echo "PSMPS Start Install Script"
echo ""
echo "You may install later using /PSMPS/psmps-install"
echo "Sorry you've got to leave :( See you next time!"
echo ""
exit 0
else #### ELSE ######
#CLEAR THE CLI
clear
echo ""
echo "PSMPS Start Install Script"
echo ""
if [ "$sContinue" != "" ] ; then
echo "You must put in exactly 'yes', or 'quit'"
echo ""
fi
echo "WARNING: THIS WILL DELETE OLD PSMPS DIR AND RE-GIT A NEW ONE!"
echo " Quit now and make backups of your configs!"
echo ""
echo "ReGit of the project is mandatory (because of updates)"
echo ""
echo "Main Install Log is inside /var/log/psmps-install"
echo ""
echo "Continue with install? Please type 'yes' or 'quit'."
read sContinue
sContinue=`echo $sContinue | tr [:upper:] [:lower:]`
echo ""
fi
done
echo "" >> /var/log/psmps-install
echo "FLUSHING PSMPS LOGS" >> /var/log/psmps-install
echo "" >> /var/log/psmps-install
rm -f /var/log/psmps*
echo "" >> /var/log/psmps-install
echo "Starting ReGit!" >> /var/log/psmps-install
echo "ReGit Log is inside /var/log/psmps-regit.log" >> /var/log/psmps-install
echo "" >> /var/log/psmps-install
cp psmps-x-scriptonly-regitproject / >> /var/log/psmps-install
# Add link in init.d to startup script
`ln -s /PSMPS/init.d/psmps /etc/init.d/psmps`
# Add links to the rc3.d rc4.d and rc5.d -- beacause update-rc.d wont work some reason. manual add.
`ln -s /PSMPS/init.d/psmps /etc/rc2.d/S09psmps`
`ln -s /PSMPS/init.d/psmps /etc/rc3.d/S09psmps`
`ln -s /PSMPS/init.d/psmps /etc/rc4.d/S09psmps`
`ln -s /PSMPS/init.d/psmps /etc/rc5.d/S09psmps`
echo ""
echo " Everything Graavvvvyyyy up til here :) "
echo ""
echo ""
echo "END OF THIS SCRIPT! THANK YOU FOR PURCHASING,"
echo "USING, AND SUPPORTING MY SCRIPT!"
echo ""
echo "kthx / kthxbai2u / kthxdie / Shawn Read"
echo "http://www.PoolServ.info/"
echo ""
echo ""
echo "LOGS inside /var/log/ directory"
echo "cat /var/log/psmps-*"
echo ""
echo ""
sleep 4
chmod +x /PSMPS/scripts/psmps-x-scriptonly-regitproject >> /var/log/psmps-install
psmps-x-scriptonly-regitproject
exit 0