diff --git a/conf/init_ynh-vpnclient b/conf/init_ynh-vpnclient index 5d68b04..a1e6fd7 100644 --- a/conf/init_ynh-vpnclient +++ b/conf/init_ynh-vpnclient @@ -25,7 +25,7 @@ is_ip6addr_set() { } is_serverip6route_set() { - server_ip6=$1 + server_ip6=${1} ip -6 route | grep -q "${server_ip6}/" } @@ -47,16 +47,16 @@ set_ip6addr() { } set_serverip6route() { - server_ip6=$1 - ip6_gw=$2 - wired_device=$3 + server_ip6=${1} + ip6_gw=${2} + wired_device=${3} ip route add "${server_ip6}/128" via "${ip6_gw}" dev "${wired_device}" } start_openvpn() { - ip6_gw=$1 - server_ip6=$2 + ip6_gw=${1} + server_ip6=${2} if [ ! -z "${ip6_gw}" -a ! -z "${server_ip6}" ]; then proto=udp6 @@ -88,9 +88,9 @@ unset_ip6addr() { } unset_serverip6route() { - server_ip6=$1 - ip6_gw=$2 - wired_device=$3 + server_ip6=${1} + ip6_gw=${2} + wired_device=${3} ip route delete "${server_ip6}/128" via "${ip6_gw}" dev "${wired_device}" } @@ -102,7 +102,7 @@ stop_openvpn() { ## Tools moulinette_get() { - var=$1 + var=${1} value=$(yunohost app setting vpnclient "${var}") @@ -115,8 +115,8 @@ moulinette_get() { } moulinette_set() { - var=$1 - value=$2 + var=${1} + value=${2} msg=$(yunohost app setting vpnclient "${var}" -v "${value}") @@ -151,7 +151,7 @@ echo "OK" # Script -case "$1" in +case "${1}" in start) if is_running; then echo "Already started" diff --git a/scripts/install b/scripts/install index de73ac0..8240778 100644 --- a/scripts/install +++ b/scripts/install @@ -1,13 +1,13 @@ #!/bin/bash # Retrieve arguments -domain=$1 -url_path=$2 -server_name=$3 -crt_client_path=$4 -crt_client_key_path=$5 -crt_server_ca_path=$6 -ip6_net=$7 +domain=${1} +url_path=${2} +server_name=${3} +crt_client_path=${4} +crt_client_key_path=${5} +crt_server_ca_path=${6} +ip6_net=${7} # Check arguments # TODO @@ -44,7 +44,6 @@ sudo install -b -o root -g root -m 0644 ../conf/phpfpm_vpnadmin.conf /etc/php5/f # Copy web sources sudo mkdir -pm 0755 /var/www/vpnadmin/ - sudo cp -a ../sources/* /var/www/vpnadmin/ sudo chown -R root: /var/www/vpnadmin/ @@ -109,7 +108,7 @@ sudo yunohost app ssowatconf # A new start will fix the interface without unsetting all stuff sudo yunohost app list -f hotspot --json | grep -q '"installed": true' if [ $? -eq 0 ]; then - sudo yunohost service start ynh-hotspot + sudo service ynh-hotspot start fi exit 0 diff --git a/scripts/remove b/scripts/remove index af6b583..a9e99c4 100644 --- a/scripts/remove +++ b/scripts/remove @@ -4,7 +4,7 @@ domain=$(sudo yunohost app setting vpnclient domain) # The End -sudo yunohost service stop ynh-vpnclient +sudo service ynh-vpnclient stop sudo yunohost service remove ynh-vpnclient sudo rm -f /etc/init.d/ynh-vpnclient @@ -31,7 +31,7 @@ sudo userdel -f vpnadmin # A new start will fix the interface without unsetting all stuff sudo yunohost app list -f hotspot --json | grep -q '"installed": true' if [ "$?" -eq 0 ]; then - sudo yunohost service start ynh-hotspot + sudo service ynh-hotspot start fi # Remove packets diff --git a/sources/views/settings.html.php b/sources/views/settings.html.php index a20b9e3..b8e7f91 100644 --- a/sources/views/settings.html.php +++ b/sources/views/settings.html.php @@ -7,62 +7,78 @@