-
Notifications
You must be signed in to change notification settings - Fork 3
/
install
133 lines (125 loc) · 3.99 KB
/
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
#/bin/bash
fun_bar () {
comando[0]="$1"
comando[1]="$2"
(
[[ -e $HOME/fim ]] && rm $HOME/fim
${comando[0]} -y > /dev/null 2>&1
${comando[1]} -y > /dev/null 2>&1
touch $HOME/fim
) > /dev/null 2>&1 &
tput civis
echo -ne "\033[1;33mAGUARDE \033[1;37m- \033[1;33m["
while true; do
for((i=0; i<18; i++)); do
echo -ne "\033[1;31m#"
sleep 0.1s
done
[[ -e $HOME/fim ]] && rm $HOME/fim && break
echo -e "\033[1;33m]"
sleep 1s
tput cuu1
tput dl1
echo -ne "\033[1;33mAGUARDE \033[1;37m- \033[1;33m["
done
echo -e "\033[1;33m]\033[1;37m -\033[1;32m OK !\033[1;37m"
tput cnorm
}
cd $HOME
clear
if [ $(id -u) -eq 0 ]
then
clear
else
if echo $(id) |grep sudo > /dev/null 2>&1
then
clear
echo -e "\033[1;37mVoce não é root"
echo -e "\033[1;37mSeu usuario esta no grupo sudo"
echo -e "\033[1;37mPara virar root execute \033[1;31msudo su\033[1;37m ou execute \033[1;31msudo $0\033[0m"
exit
else
clear
echo -e "Vc nao esta como usuario root, nem com seus direitos (sudo)\nPara virar root execute \033[1;31msu\033[0m e digite sua senha root"
exit
fi
fi
function sshd_config(){ echo "Port 22
Protocol 2
KeyRegenerationInterval 3600
ServerKeyBits 1024
SyslogFacility AUTH
LogLevel INFO
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
PermitEmptyPasswords no
ChallengeResponseAuthentication no
PasswordAuthentication yes
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
UsePAM yes" > /etc/ssh/sshd_config
}
function apch2(){
sed -i "s/Listen 80/Listen 81/g" /etc/apache2/ports.conf > /dev/null 2>&1
}
function inst_pct () {
_pacotes=("bc" "screen" "nano" "unzip" "man" "dos2unix" "nload" "htop" "jq" "curl" "python")
for _prog in ${_pacotes[@]}; do
apt-get install $_prog -y > /dev/null 2>&1
done
}
clear
echo -e "\033[01;31mINICIANDO CONFIGURAÇÃO\033[0m"
echo ""
apch2
sshd_config
fun_bar 'inst_pct'
mkdir /etc/VpsPackdir 2>/dev/null
mkdir /etc/VpsPackdir/limite 2>/dev/null
mkdir /etc/VpsPackdir/senha 2>/dev/null
rm -rf /bin/limite 2>/dev/null
wget -o /dev/null -O- https://raw.githubusercontent.com/twossh/vpspack/master/limite > /bin/limite
chmod +x /bin/limite
rm -rf /bin/criarusuario 2>/dev/null
wget -o /dev/null -O- https://raw.githubusercontent.com/twossh/vpspack/master/criarusuario > /bin/criarusuario
chmod +x /bin/criarusuario
rm -rf /bin/deletarusuario 2>/dev/null
wget -o /dev/null -O- https://raw.githubusercontent.com/twossh/vpspack/master/deletarusuario > /bin/deletarusuario
chmod +x /bin/deletarusuario
rm -rf /bin/redefinirusuario 2>/dev/null
wget -o /dev/null -O- https://raw.githubusercontent.com/twossh/vpspack/master/redefinirusuario > /bin/redefinirusuario
chmod +x /bin/redefinirusuario
rm -rf /bin/menu 2>/dev/null
wget -o /dev/null -O- https://raw.githubusercontent.com/twossh/vpspack/master/menu > /bin/menu
chmod +x /bin/menu
rm -rf /bin/speedtest.py 2>/dev/null
wget -o /dev/null -O- https://raw.githubusercontent.com/twossh/vpspack/master/speedtest.py > /bin/speedtest.py
chmod +x /bin/speedtest.py
rm -rf /bin/proxy.py 2>/dev/null
wget https://raw.githubusercontent.com/twossh/vpspack/master/proxy.py -O /bin/proxy.py > /dev/null 2>&1
chmod +x /bin/proxy.py
rm -rf /bin/badvpn-udpgw 2>/dev/null
wget -O /bin/badvpn-udpgw https://github.com/twossh/vpspack/blob/master/badvpn-udpgw?raw=true -o /dev/null
chmod +x /bin/badvpn-udpgw
rm -rf /etc/autostart 2>/dev/null
wget -o /dev/null -O- https://raw.githubusercontent.com/twossh/vpspack/master/autostart > /etc/autostart
chmod +x /etc/autostart
[[ $(crontab -l|grep -c "autostart") = '0' ]] && (crontab -l 2>/dev/null; echo -e "@reboot /etc/autostart\n* * * * * /etc/autostart") | crontab -
service apache2 restart > /dev/null 2>&1
service ssh restart > /dev/null 2>&1
service apache2 restart > /dev/null 2>&1
clear
echo -e "\033[1;31mINSTALACAO CONCLUIDA\n\n\033[1;31mCOMANDO PRINCIPAL: \033[1;33mmenu\033[0m"
rm -rf install