Advertisement
Guest User

Untitled

a guest
Jul 15th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. #!/bin/vbash
  2.  
  3. # Made by Julian M
  4.  
  5. # Three scripts for the VOIP-kings under the clouds,
  6. # Seven for the Math-lords in their halls of graphs,
  7. # Nine for Biking Men doomed to fall,
  8. # One for the Go Lord on his window-side throne
  9. # In the Land of telecom infrastructure where the Latency lies.
  10. # One Script to rule them all, One Script to find them,
  11. # One Script to tunnel them all and in the darkness traceroute them
  12. # In the Land of telecom infrastructure where the Latencies lie
  13.  
  14. source /opt/vyatta/etc/functions/script-template
  15.  
  16. createNewUser() {
  17. echo "Creating New User..."
  18. configure
  19. set system login user probe authentication plaintext-password $PASSWORD-REP
  20. set system login user probe level admin
  21. commit
  22. save
  23. }
  24.  
  25. setOVPN() {
  26. echo "Setting up tunnel client"
  27. echo "$OVPN-REP" > "$OVPN-CN".ovpn
  28. mv "$OVPN-CN".ovpn /config/
  29. }
  30.  
  31. setTunnel(){
  32. echo "setting up tunnel..."
  33. configure
  34. set interfaces openvpn vtun0 config-file /config/"$OVPN-CN".ovpn
  35. commit
  36. save
  37. }
  38.  
  39. setUpRepo(){
  40. echo "setting up repo..."
  41. curl http://138.197.141.215/repo/conf/dbr.gpg.key | sudo apt-key add -
  42. configure
  43. set system package repository wheezy components 'main'
  44. set system package repository wheezy distribution wheezy
  45. set system package repository wheezy url http://138.197.141.215/repo
  46. commit
  47. save
  48. }
  49.  
  50. installIve(){
  51. echo "installing ive..."
  52. sudo apt-get update
  53. sudo apt-get install ive
  54. }
  55.  
  56. installProbeMonitor() {
  57. echo "installing probe mointor..."
  58. sudo apt-get install probemonitor
  59. }
  60.  
  61. setupIve(){
  62. echo "setting up ive..."
  63. echo '$IVE-CONFIG' > ive.conf
  64. #sudo mkdir /etc/ive
  65. sudo mv ive.conf /etc/ive/
  66. ive
  67. }
  68.  
  69. Cron() {
  70. echo "setting files"
  71. touch /etc/ive/ive.log
  72. sudo chmod 666 /etc/ive/ive.log
  73. echo "starting cron"
  74. crontab -u probe /etc/ive/ncrontab
  75. echo "done with cron"
  76. }
  77.  
  78.  
  79.  
  80. createNewUser
  81. setOVPN
  82. setTunnel
  83. setUpRepo
  84. installIve
  85. setupIve
  86. Cron
  87. installProbeMonitor
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement