Browse Source

Fix install and remove

Julien VAUBOURG 10 years ago
parent
commit
de2ae1d5f7
2 changed files with 12 additions and 9 deletions
  1. 4 4
      scripts/install
  2. 8 5
      scripts/remove

+ 4 - 4
scripts/install

@@ -38,7 +38,7 @@ sudo yunohost app setting vpnclient crt_server_ca -v ${crt_server_ca}
 sudo install -b -o root -g root -m 0644 ../conf/client.conf.tpl /etc/openvpn/
 
 # Create certificates
-mkdir -pm 0700 /etc/openvpn/keys/
+sudo mkdir -pm 0700 /etc/openvpn/keys/
 
 sudo cat << EOF > /etc/openvpn/keys/user.crt
 ${crt_client}
@@ -50,7 +50,7 @@ sudo cat << EOF > /etc/openvpn/keys/ca-server.crt
 ${crt_server_ca}
 EOF
 
-sudo chown root: /etc/openvpn/keys/*
+sudo chown -R root: /etc/openvpn/keys/
 sudo chmod 0600 /etc/openvpn/keys/*
 
 # Fix confs
@@ -67,8 +67,8 @@ sudo sed "s|<TPL:IP6_INTERCO>|${ip6_interco}|g" -i /etc/init.d/ynh-vpnclient
 sudo sed "s|<TPL:WIRED_DEVICE>|${wired_device}|g" -i /etc/init.d/ynh-vpnclient
 
 # Set default inits
-# The boot order of these services are important, so they are disabled by default
-# and the ynh-vpnclient service handles them.
+# The openvpn configuration is modified before the start, so the service is disabled by default
+# and the ynh-vpnclient service handles it.
 # All services are registred by yunohost in order to prevent conflicts after the uninstall.
 sudo yunohost service add openvpn
 sudo yunohost service stop openvpn

+ 8 - 5
scripts/remove

@@ -1,16 +1,19 @@
 #!/bin/bash
 
 # The End
-sudo yunohost service stop ynh-hotspot
-sudo yunohost service remove ynh-hotspot
-sudo rm -f /etc/init.d/ynh-hotspot
+sudo yunohost service stop ynh-vpnclient
+sudo yunohost service remove ynh-vpnclient
+sudo rm -f /etc/init.d/ynh-vpnclient
 
 # Remove confs
-sudo rm -rf /etc/hostapd/ /etc/radvd.conf /etc/dhcp/dhcpd.conf
+sudo rm -f /etc/openvpn/client.conf* 
+
+# Remove certificates
+sudo rm -rf /etc/openvpn/keys/
 
 # Remove packets
 # The yunohost policy is currently to not uninstall packets (dependency problems)
-## sudo apt-get --assume-yes --force-yes remove hostapd radvd isc-dhcp-server iptables
+## sudo apt-get --assume-yes --force-yes remove openvpn
 ## sudo apt-get --assume-yes --force-yes remove sipcalc
 
 exit 0