install 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/bin/bash
  2. source _common.sh
  3. source /usr/share/yunohost/helpers
  4. # Default values for config panel
  5. ynh_app_setting_set --key="service_enabled" --value="0"
  6. ynh_app_setting_set --key="dns_method" --value="yunohost"
  7. ynh_app_setting_set --key="nameservers" --value=""
  8. ynh_app_setting_set --key="ip6_addr" --value=""
  9. ynh_app_setting_set --key="ip6_net" --value=""
  10. ynh_app_setting_set --key="ip6_send_over_tun_enabled" --value="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/vpnclient/ynh-vpnclient.log"
  27. yunohost service enable $service_name
  28. ynh_config_add_logrotate
  29. # checker service
  30. systemctl start $service_checker_name
  31. systemctl enable $service_checker_name --quiet
  32. systemctl start $service_checker_name.timer
  33. systemctl enable $service_checker_name.timer --quiet
  34. #=================================================
  35. # END OF SCRIPT
  36. #=================================================
  37. ynh_script_progression "Installation of $app completed"