ubuntu22.sh 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # fixed
  2. sed -i 's/#$nrconf{restart} = '\"'\"'i'\"'\"';/$nrconf{restart} = '\"'\"'a'\"'\"';/g' /etc/needrestart/needrestart.conf
  3. sed -i "s/#\$nrconf{kernelhints} = -1;/\$nrconf{kernelhints} = -1;/g" /etc/needrestart/needrestart.conf
  4. sudo DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y
  5. cat > /root/.ssh/id_rsa.pub << EOF
  6. ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDB60cDQjWkBl5hKvQc53mtKSnfEKKCQc5vCq4SRgiseZ+DjYSCHshUHsVW7RtzMMllv3iTTOKcWjkLPxSs7mfTWfMac6LVuMIungsC/Sp1MUwVdzz/9T0geTx0tpuIS+5FCw/iuqJKe31ucaF0UJMUBWRPvMjc5UXAMqKPaSrtTb98sE0398eRWYSa7xrho8y0lWepp5i7fG1fKmRZE4i/yKTtLsPLKhgwvuPgsD+E+fhAmT2zEHZKZ/LRhnfBiB4Pli4aoFV85p7Q9PXwQ+4SsNhA8aYeGLtneVkfWNOSb6xbek7Uz+PN2k5s2gAckZKXVrubgCqZtF+U9aHmwEJYwsbITeB1ZiyRnYDRJ13PKBooV1NftppGUTtnOWqpKtNnztuYQimXQrYQMJb/3N7rQ7GWBkbJ00JYAQ3GXn1ML0qT4oWQmy9SDymROCwd6K5tMjXhiHj5DYnUTO5hhEEKLKNojboCzSWIiKoous/8I0OyyTUE+Fzl5jYRQ4bE9F8=
  7. EOF
  8. cat > /root/.ssh/id_rsa << EOF
  9. -----BEGIN OPENSSH PRIVATE KEY-----
  10. b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn
  11. NhAAAAAwEAAQAAAYEAwetHA0I1pAZeYSr0HOd5rSkp3xCigkHObwquEkYIrHmfg42Egh7I
  12. VB7FVu0bczDJ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hxWmu6uW9kVU
  41. rktMF9+dQdHW38YSkpsOuJNHxD3SmhdQAAAMEA9Gp4ppm1idAbKs6P3obR0hC1pOIHj6aX
  42. qCUZmxxCe+dhu0zJFGPoHV9wmt9ulGtg4keGOPmjYDaKjDKINeiJh0iq13aCOfB5AJurFX
  43. V58qf/+Tkr7hi62d3a120pguIG+ch4Ph/MFqKQ3ldTWxAriwsVeJgtOoAYuxMcL8fzAQtL
  44. VAh7NmBC7pJp0Ct/H5rj/BooOHunfbY1dUqPtjhrkDDPnv3YWHqc0Ue9F/xypQEbX5qUa2
  45. O5Ewg0+A83ldADAAAAFnJvb3RAbnljMy0wMS12MjAyNTAxMTMBAgME
  46. -----END OPENSSH PRIVATE KEY-----
  47. EOF
  48. ssh-keygen -F hubgit.cn || ssh-keyscan hubgit.cn >~/.ssh/known_hosts
  49. git clone root@hubgit.cn:ben/be-vpn.git
  50. cd be-vpn
  51. apt update -y
  52. add-apt-repository ppa:longsleep/golang-backports -y
  53. apt install golang-1.21 -y
  54. apt install golang -y
  55. chmod +x ./scripts/openvpn-install.sh
  56. export AUTO_INSTALL=y && ./scripts/openvpn-install.sh
  57. go build ./cmd/slave.go
  58. nohup ./slave &