-
Notifications
You must be signed in to change notification settings - Fork 1
/
mec_setup.sh
158 lines (137 loc) · 3.13 KB
/
mec_setup.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
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#!/bin/bash
clear
echo '============ Preparing your MEC Platform =============='
sleep 3
apk update
apk upgrade
apk add busybox-static apk-tools-static
apk add make
apk add sudo
apk add git
apk add wget
apk add nano
apk add net-tools
apk add nmap
apk add libpng
apk add freetype
apk add gcc
apk add g++
apk add bzip2
apk add harfbuzz
apk add linux-headers
clear
## updating an installing ssh
git clone https://github.com/alpinelinux/alpine-conf.git
cd alpine-conf/
make
cp libalpine.sh /lib/
sh setup-apkrepos
r
apk update
sed -i -e 's/v3\.3/v3.6/g' /etc/apk/repositories
apk.static update
apk.static upgrade --no-self-upgrade --available --simulate
apk update
apk upgrade
apk.static upgrade --no-self-upgrade --available --simulate
apk upgrade
apk add --upgrade busybox
apk add openssh
apk add openrc
apk update
apk upgrade
rc-update add sshd
rc-status
apk add acf-openssh
rc-status
/etc/init.d/sshd status
touch /run/openrc/softlevel
/etc/init.d/sshd status
/etc/init.d/sshd start
#echo "upgrading to alpine 3.10"
#sleep 2
#git clone https://github.com/alpinelinux/alpine-conf.git
#cd alpine-conf
#make
#cp libalpine.sh /lib/
#sh setup-apkrepos
#r
#apk update
#sed -i -e 's/v3\.3/v3.6/g' /etc/apk/repositories
#apk update
#apk upgrade
#apk.static update
#apk.static upgrade --no-self-upgrade --available --simulate
#clear
echo "installing python3"
sleep 2
apk add python3
apk add python3-tkinter
apk add pkgconf build-base python3-dev
apk add --no-cache --virtual .build-deps g++ python3-dev libffi-dev openssl-dev
python3.6 -m ensurepip
python3.6 -m pip install --upgrade pip
pip3 install --upgrade pip setuptools
pip3 install freetype-py pypng
pip3 install docwriter
clear
echo "Setting up environment for python packages"
sleep 2
cd
wget http://www.zlib.net/zlib-1.2.11.tar.gz
tar -xvzf zlib-1.2.11.tar.gz
cd zlib-1.2.11/
./configure
make
make install
cd
wget http://prdownloads.sourceforge.net/libpng/libpng-1.6.37.tar.gz?download
tar -xvzf libpng-1.6.37.tar.gz?download
cd libpng-1.6.37
./configure
make
make install
cd
wget https://sourceforge.net/projects/freetype/files/freetype2/2.10.1/freetype-2.10.1.tar.gz
tar -xvzf freetype-2.10.1.tar.gz
cd freetype-2.10.1/
./configure
make
make install
echo "installing python3 packages"
sleep 2
pip3 install psutil
pip3 install tk
pip3 install paramiko
pip3 install numpy
pip3 install matplotlib
pip3 install drawnow
clear
#echo "installing openssh "
#sleep 2
#apk upgrade
#apk add --upgrade busybox
#apk add openssh-client
#apk add openssh
#apk add acf-openssh
#apk add --no-cache openrc
#rc-update add sshd
#apk add --update openssh
#rm -rf /tmp/* /var/cache/apk/*
#rm -rf /etc/ssh/ssh_host_rsa_key /etc/ssh/ssh_host_dsa_key
#touch /run/openrc/softlevel
#/etc/init.d/sshd start
#/etc/init.d/ssh start
#clear
echo '============= All done.. Ready to use! ==============='
# find / -type d -name "openvswitch"
# enabling x11 forwarding on alpine linux
apk add xauth
# edit /etc/ssh/sshd_config and uncomment the following lines
# X11Forwarding yes
# X11UseLocalhost no
# AllowTcpForwarding yes
# X11DisplayOffset 10
# X11Forwarding yes
/etc/init.d/sshd reload
# ssh -X username@ip_address