-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdeploy.sh
executable file
·45 lines (35 loc) · 1.33 KB
/
deploy.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
#!/bin/bash
sudo apt-get update
wget https://packages.microsoft.com/config/debian/10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update; \
sudo apt-get install -y apt-transport-https && \
sudo apt-get update && \
sudo apt-get install -y dotnet-sdk-3.1
sudo apt-get update; \
sudo apt-get install -y apt-transport-https && \
sudo apt-get update && \
sudo apt-get install -y aspnetcore-runtime-3.1
sudo apt-get install -y dotnet-runtime-3.1
sudo apt-get install -y aptitude
sudo aptitude install -y tcpdump
sudo aptitude install -y bridge-utils
sudo aptitude install -y vlan
sudo aptitude install -y tmux
sudo aptitude install -y gnupg
sudo aptitude install -y ebtables
sudo aptitude install -y unzip
sudo aptitude install -y snmpd
sudo aptitude install -y snmp
sudo aptitude install -y libsnmp-dev
#SNMP
sudo systemctl start snmpd
export DEBIAN_FRONTEND=noninteractive
sudo dotnet publish -c Release EthernetSwitch
dir=`pwd`
sudo sed -i "s/PROJECT_PATH/${dir//\//\\/}/g" EthernetSwitch/ethernet-switch.service
sudo cp EthernetSwitch/ethernet-switch.service /etc/systemd/system/ethernet-switch.service
sudo systemctl daemon-reload
sudo systemctl enable ethernet-switch.service
sudo systemctl start ethernet-switch.service
sudo systemctl status ethernet-switch.service