-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
123 lines (118 loc) · 3.26 KB
/
install.sh
File metadata and controls
123 lines (118 loc) · 3.26 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
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
#!/bin/bash
function normal () {
wget https://download.mikrotik.com/routeros/6.48.3/chr-6.48.3.img.zip -O chr.img.zip && \
gunzip -c chr.img.zip > chr.img && \
mount -o loop,offset=512 chr.img /mnt && \
ADDRESS=`ip addr show eth0 | grep global | cut -d' ' -f 6 | head -n 1` && \
GATEWAY=`ip route list | grep default | cut -d' ' -f 3` && \
echo "/ip address add address=$ADDRESS interface=[/interface ethernet find where name=ether1]
/ip route add gateway=$GATEWAY
" > /mnt/rw/autorun.scr && \
umount /mnt && \
echo u > /proc/sysrq-trigger && \
dd if=chr.img bs=1024 of=/dev/vda
echo "============================"
echo "=== Instalation Complete ==="
echo "============================"
echo "=== Detail Login ==="
echo "Host : IPVPS"
echo "Username : admin"
echo "Password : blank (empty)"
echo "============================"
echo " VPS Going to reboot on 5 sec "
echo "============================"
sleep 5
echo b > /proc/sysrq-trigger
}
function aws ()
{
wget https://download.mikrotik.com/routeros/6.48.3/chr-6.48.3.img.zip -O chr.img.zip && \
gunzip -c chr.img.zip > chr.img && \
mount -o loop,offset=512 chr.img /mnt && \
ADDRESS=`ip addr show eth0 | grep global | cut -d' ' -f 6 | head -n 1` && \
GATEWAY=`ip route list | grep default | cut -d' ' -f 3` && \
echo "/ip address add address=$ADDRESS interface=[/interface ethernet find where name=ether1]
/ip route add gateway=$GATEWAY
" > /mnt/rw/autorun.scr && \
umount /mnt && \
echo u > /proc/sysrq-trigger && \
dd if=chr.img bs=1024 of=/dev/xvda
echo "============================"
echo "=== Instalation Complete ==="
echo "============================"
echo "=== Detail Login ==="
echo "Host : IPVPS"
echo "Username : admin"
echo "Password : blank (empty)"
echo "============================"
echo " VPS Going to reboot on 5 sec "
echo "============================"
sleep 5
echo b > /proc/sysrq-trigger
}
function menu () {
echo "============================================"
echo "Auto Installer Mikrotik CHR ON Ubuntu 16.04 "
echo "============================================"
echo "= Script Created : ="
echo "=================="
echo "==== Iqbalfaf ===="
echo "=================="
echo ""
echo "= Menu : ="
echo "========================================"
echo "(1). VPS KVM Digital Ocean,Vultr,Other"
echo "(2). VPS LightSail Aws"
echo "(0). Exit"
echo "========================================="
read -p " Input Number : " milih
if test $milih == '1'
then
normal
elif test $milih == '2'
then
aws
elif test $milih == '0'
then
sleep 3
clear
echo " thank u for using this script "
else
echo "Wrong Number... try again"
sleep 2
clear
menu
fi
}
echo "============================================"
echo "Auto Installer Mikrotik CHR ON Ubuntu 16.04 "
echo "============================================"
echo "= Script Created : ="
echo "=================="
echo "==== Iqbalfaf ===="
echo "=================="
echo ""
echo "= Menu : ="
echo "========================================"
echo "(1). VPS KVM Digital Ocean,Vultr,Other"
echo "(2). VPS LightSail Aws"
echo "(0). Exit"
echo "========================================="
read -p " Input Number : " milih
if test $milih == '1'
then
normal
elif test $milih == '2'
then
aws
elif test $milih == '0'
then
sleep 3
clear
echo " thank u for using this script "
else
echo "Wrong Number... try again"
sleep 2
clear
menu
fi