Browse Source

[fix] VPNClient for yunohost 11

ljf 3 years ago
parent
commit
9595eb281b
5 changed files with 5 additions and 6 deletions
  1. 0 2
      conf/openvpn@.service
  2. 1 1
      manifest.json
  3. 2 1
      scripts/_common.sh
  4. 1 1
      scripts/backup
  5. 1 1
      scripts/restore

+ 0 - 2
conf/openvpn@.service

@@ -1,5 +1,3 @@
-.include /lib/systemd/system/openvpn@.service
-
 [Service]
 Restart=always
 RestartSec=1

+ 1 - 1
manifest.json

@@ -6,7 +6,7 @@
     "en": "Tunnel the internet traffic through a VPN",
     "fr": "Fait passer le trafic internet à travers un VPN"
   },
-  "version": "2.0.1~ynh7",
+  "version": "2.0.2~ynh7",
   "url": "https://labriqueinter.net",
   "license": "AGPL-3.0",
   "maintainer": {

+ 2 - 1
scripts/_common.sh

@@ -25,10 +25,11 @@ function vpnclient_deploy_files_and_services()
   chown root:${app} /etc/openvpn/
   chmod 775 /etc/openvpn/
   mkdir -pm 0755 /etc/yunohost/hooks.d/post_iptable_rules/
+  mkdir -pm 0755 /etc/systemd/system/openvpn@.service.d/
 
   install -b -o root -g ${app} -m 0644 ../conf/openvpn_client.conf.tpl /etc/openvpn/client.conf.tpl
   install -b -o root -g root -m 0755 ../conf/hook_post-iptable-rules /etc/yunohost/hooks.d/90-vpnclient.tpl
-  install -b -o root -g root -m 0644 ../conf/openvpn@.service /etc/systemd/system/
+  install -b -o root -g root -m 0644 ../conf/openvpn@.service /etc/systemd/system/openvpn@.service.d/override.conf
 
   # Create certificates directory
   mkdir -pm 0770 /etc/openvpn/keys/

+ 1 - 1
scripts/backup

@@ -50,7 +50,7 @@ ynh_print_info "Backing up systemd configuration..."
 ynh_backup "/etc/systemd/system/$service_name.service"
 ynh_backup "/etc/systemd/system/$service_checker_name.service"
 ynh_backup "/etc/systemd/system/$service_checker_name.timer"
-ynh_backup "/etc/systemd/system/openvpn@.service"
+ynh_backup "/etc/systemd/system/openvpn@.service.d/ovveride.conf"
 
 #=================================================
 # END OF SCRIPT

+ 1 - 1
scripts/restore

@@ -64,7 +64,7 @@ ynh_print_info "Restoring the systemd configuration..."
 ynh_restore_file "/etc/systemd/system/$service_name.service"
 ynh_restore_file "/etc/systemd/system/$service_checker_name.service"
 ynh_restore_file "/etc/systemd/system/$service_checker_name.timer"
-ynh_restore_file "/etc/systemd/system/openvpn@.service"
+ynh_restore_file "/etc/systemd/system/openvpn@.service.d/ovveride.conf"
 systemctl daemon-reload
 systemctl enable "$service_name.service" --quiet
 systemctl enable "$service_checker_name.service" --quiet