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 "$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. ynh_use_logrotate --logfile="/var/log/ynh-vpnclient.log"
  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 --message="Installation of $app completed" --last