freedombone-app-vpn 2.1KB

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