freedombone-app-vpn 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/bash
  2. #
  3. # .---. . .
  4. # | | |
  5. # |--- .--. .-. .-. .-.| .-. .--.--. |.-. .-. .--. .-.
  6. # | | (.-' (.-' ( | ( )| | | | )( )| | (.-'
  7. # ' ' --' --' -' - -' ' ' -' -' -' ' - --'
  8. #
  9. # Freedom in the Cloud
  10. #
  11. # VPN functions
  12. #
  13. # License
  14. # =======
  15. #
  16. # Copyright (C) 2014-2016 Bob Mottram <bob@robotics.uk.to>
  17. #
  18. # This program is free software: you can redistribute it and/or modify
  19. # it under the terms of the GNU Affero General Public License as published by
  20. # the Free Software Foundation, either version 3 of the License, or
  21. # (at your option) any later version.
  22. #
  23. # This program is distributed in the hope that it will be useful,
  24. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  25. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  26. # GNU Affero General Public License for more details.
  27. #
  28. # You should have received a copy of the GNU Affero General Public License
  29. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  30. function backup_vpn {
  31. echo ''
  32. }
  33. function remove_vpn {
  34. apt-get -y remove --purge fastd
  35. }
  36. function install_vpn {
  37. if ! grep -q "repo.universe-factory.net" /etc/apt/sources.list; then
  38. echo 'deb http://repo.universe-factory.net/debian/ sid main' >> /etc/apt/sources.list
  39. gpg --keyserver pgpkeys.mit.edu --recv-key 16EF3F64CB201D9C
  40. if [ ! "$?" = "0" ]; then
  41. exit 76272
  42. fi
  43. gpg -a --export 16EF3F64CB201D9C | sudo apt-key add -
  44. apt-get update
  45. apt-get -y install fastd
  46. if [ ! "$?" = "0" ]; then
  47. exit 52026
  48. fi
  49. fi
  50. }
  51. # NOTE: deliberately there is no "exit 0"