Parcourir la source

cleanup previously uploaded config files

HgO il y a 1 an
Parent
commit
880264299f
1 fichiers modifiés avec 4 ajouts et 1 suppressions
  1. 4 1
      scripts/config

+ 4 - 1
scripts/config

@@ -213,7 +213,6 @@ ynh_app_config_validate() {
         cp -f "$config_file" "$cube_file"
 
         convert_cube_file "$config_file"
-
     # Othewise, assume that it's a .ovpn / .conf
     elif [ -f "${config_file}" ]
     then
@@ -249,6 +248,10 @@ ynh_app_config_apply() {
     set_permissions /etc/openvpn/keys/user.key
     set_permissions /etc/openvpn/keys/user_ta.key
 
+    # Cleanup previously uploaded config file
+    [[ -f $cube_file ]] || rm -f /etc/openvpn/client.cube
+    [[ -f $ovpn_file ]] || rm -f /etc/openvpn/client.ovpn
+
     # Start vpn client
     ynh_print_info --message="Starting vpnclient service if needed"
     /usr/local/bin/ynh-vpnclient start