install 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/bin/bash
  2. source _common.sh
  3. source /usr/share/yunohost/helpers
  4. # Default values for config panel
  5. ynh_app_setting_set "$app" service_enabled 0
  6. ynh_app_setting_set "$app" dns_method "yunohost"
  7. ynh_app_setting_set "$app" nameservers ""
  8. ynh_app_setting_set "$app" ip6_addr ""
  9. ynh_app_setting_set "$app" ip6_net ""
  10. ynh_app_setting_set "$app" ip6_send_over_tun_enabled 0
  11. #=================================================
  12. # DEPLOY FILES FROM PACKAGE
  13. #=================================================
  14. ynh_script_progression "Deploy files from package..."
  15. vpnclient_deploy_files_and_services
  16. #=================================================
  17. # RELOAD SERVICES
  18. #=================================================
  19. ynh_script_progression "Reloading services..."
  20. # Set default inits
  21. # The boot order of these services are important, so they are disabled by default
  22. # and the vpnclient service handles them.
  23. systemctl disable openvpn --quiet
  24. systemctl stop openvpn
  25. # main service
  26. yunohost service add $service_name --description "Tunnels the internet traffic through a VPN" --need_lock --test_status="systemctl is-active openvpn@client.service" --log "/var/log/ynh-vpnclient.log"
  27. yunohost service enable $service_name
  28. # checker service
  29. systemctl start $service_checker_name
  30. systemctl enable $service_checker_name --quiet
  31. systemctl start $service_checker_name.timer
  32. systemctl enable $service_checker_name.timer --quiet
  33. #=================================================
  34. # END OF SCRIPT
  35. #=================================================
  36. ynh_script_progression --message="Installation of $app completed" --last