-
Notifications
You must be signed in to change notification settings - Fork 47
/
start.sh
35 lines (23 loc) · 969 Bytes
/
start.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
#!/bin/bash
export LC_ALL="en_US.utf8"
iptables --flush
/scripts/restartsrv_cpsrvd
systemctl restart mysql
echo "[client]" > /root/.my.cnf;
echo "password=" >> /root/.my.cnf;
echo "user=root" >> /root/.my.cnf;
mysql_password=$(</dev/urandom tr -dc '12345!@#$%qwertQWERTasdfgASDFGzxcvbZXCVB' | head -c8; echo "");
/scripts/mysqlpasswd root $mysql_password
# cp /root/.my.cnf /root/.$mysql_password.pass;
/scripts/mysqlconnectioncheck
rm -rf /var/cpanel/cpnat
new_ip=$(ifconfig | grep 'inet'| grep -v '127.0.0.1'| cut -d: -f2 | awk '{ print $2}' |grep -v "10." |grep -v '^\s*$');
#echo $new_ip > /var/cpanel/cpnat;
grep -q ADDR /etc/wwwacct.conf && sed -i_bak "s/\(ADDR\) .*/\1 $new_ip/" /etc/wwwacct.conf || echo "ADDR $new_ip" >> /etc/wwwacct.conf
/scripts/mainipcheck
killall /usr/local/cpanel/bin/safeapacherestart
killall /usr/local/cpanel/scripts/restartsrv_httpd
killall /usr/bin/systemctl
/scripts/rebuildhttpdconf
/scripts/restartsrv_httpd
/bin/bash