Blame view

centos-after-install.sh 2.03 KB
8c59d6ffe   Adhidarma Hadiwinoto   commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
  #!/bin/bash
  
  echo
  echo ================
  echo Tektrans - Finnet AD2MT post OS install script
  echo ================
  echo
  
  read -p 'IP PeerVPN: ' ippeervpn < /dev/tty
  if [ -z "$ippeervpn" ]; then
  	echo "Invalid peervpn ip";
  	exit
  fi
  
  set -x
  
  sudo useradd komodo
  sudo usermod -a -G dialout komodo
bc851e628   Adhidarma Hadiwinoto   nodejs from nodes...
19
  sudo usermod -a -G systemd-journal
8c59d6ffe   Adhidarma Hadiwinoto   commit
20
21
  
  sudo yum -y install epel-release
8c59d6ffe   Adhidarma Hadiwinoto   commit
22
  sudo yum -y groupinstall "Development Tools"
bc851e628   Adhidarma Hadiwinoto   nodejs from nodes...
23
24
  sudo yum -y remove nodejs
  curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
742dfa679   Adhidarma Hadiwinoto   bash-completion a...
25
  sudo yum -y install nodejs iftop vim-enhanced wget nmap traceroute net-tools telnet minicom iperf htop bwm-ng bash-completion bash-completion-extras
bc851e628   Adhidarma Hadiwinoto   nodejs from nodes...
26
  sudo yum -y update
8c59d6ffe   Adhidarma Hadiwinoto   commit
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
  sudo npm install -g nodemon
  sudo npm install -g mocha
  
  mkdir src
  cd ~src
  wget https://peervpn.net/files/peervpn-0-044-linux-x86.tar.gz
  tar xzf peervpn-0-044-linux-x86.tar.gz
  cd peervpn-0-044
  sudo install peervpn /usr/local/sbin/
  sudo mkdir /etc/peervpn
  sudo rm -f /etc/peervpn/tektrans.conf
  sudo tee /etc/peervpn/tektrans.conf << EOF
  networkname Tektrans
  psk fc905de75a79a346abc58c256f950a7d3d015e99
  enabletunneling yes
  enablerelay yes
32ee17c10   Adhidarma Hadiwinoto   disable ipv6 peervpn
43
44
  enableipv4 yes
  enableipv6 no
8c59d6ffe   Adhidarma Hadiwinoto   commit
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
  interface pvpntektrans
  initpeers 122.248.38.20 7010 128.199.161.36 7003
  EOF
  
  echo ifconfig4 $ippeervpn/24 | sudo tee -a /etc/peervpn/tektrans.conf
  
  sudo tee /etc/systemd/system/peervpn@.service << EOF
  [Unit]
  Description=PeerVPN Node (%i)
  After=syslog.target network.target
  ConditionPathExists=/etc/peervpn/%i.conf
  
  [Service]
  Type=simple
  ExecStart=/usr/local/sbin/peervpn /etc/peervpn/%i.conf
  
  [Install]
  WantedBy=multi-user.target
  EOF
93107498c   Adhidarma Hadiwinoto   komodo-gateway sy...
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
  sudo tee /etc/systemd/system/komodo-gateway@.service << EOF
  [Unit]
  Description=Komodo Gateway- %i
  After=syslog.target network.target komodo-core.service
  
  [Service]
  Environment=KOMODO_DEBUG_MODEM="1"
  Type=simple
  WorkingDirectory=/home/komodo/gateways/%i
  ExecStart=/usr/bin/node index.js
  Restart=always
  User=komodo
  Group=komodo
  StandardError=journal
  
  [Install]
  WantedBy=multi-user.target
  EOF
8c59d6ffe   Adhidarma Hadiwinoto   commit
82
83
  sudo systemctl daemon-reload
  sudo systemctl enable peervpn@tektrans
f01723d06   Adhidarma Hadiwinoto   peervpn start aft...
84
  sudo systemctl restart peervpn@tektrans