freedombone-app-vpn 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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@freedombone.net>
  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. VARIANTS=''
  31. IN_DEFAULT_INSTALL=0
  32. SHOW_ON_ABOUT=0
  33. vpn_variables=()
  34. function logging_on_vpn {
  35. echo -n ''
  36. }
  37. function logging_off_vpn {
  38. echo -n ''
  39. }
  40. function install_interactive_vpn {
  41. echo -n ''
  42. APP_INSTALLED=1
  43. }
  44. function reconfigure_vpn {
  45. echo -n ''
  46. }
  47. function upgrade_vpn {
  48. echo -n ''
  49. }
  50. function backup_local_vpn {
  51. echo -n ''
  52. }
  53. function restore_local_vpn {
  54. echo -n ''
  55. }
  56. function backup_remote_vpn {
  57. echo -n ''
  58. }
  59. function restore_remote_vpn {
  60. echo -n ''
  61. }
  62. function remove_vpn {
  63. apt-get -yq remove --purge fastd
  64. remove_completion_param install_vpn
  65. }
  66. function install_vpn {
  67. if ! grep -q "repo.universe-factory.net" /etc/apt/sources.list; then
  68. echo 'deb http://repo.universe-factory.net/debian/ sid main' >> /etc/apt/sources.list
  69. gpg --keyserver pgpkeys.mit.edu --recv-key 16EF3F64CB201D9C
  70. if [ ! "$?" = "0" ]; then
  71. exit 76272
  72. fi
  73. gpg -a --export 16EF3F64CB201D9C | sudo apt-key add -
  74. apt-get update
  75. apt-get -yq install fastd
  76. if [ ! "$?" = "0" ]; then
  77. exit 52026
  78. fi
  79. fi
  80. APP_INSTALLED=1
  81. }
  82. # NOTE: deliberately there is no "exit 0"