freedombone-app-vpn 2.1KB

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