Some fix
This commit is contained in:
@@ -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"
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -7,6 +7,12 @@
|
||||
<form method="post" enctype="multipart/form-data" action="?/settings" class="form-horizontal" role="form">
|
||||
<input type="hidden" name="_method" value="put" />
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><?= T_("VPN") ?></h3>
|
||||
</div>
|
||||
|
||||
<div style="padding: 14px 14px 0 10px">
|
||||
<div class="form-group">
|
||||
<label for="server_name" class="col-sm-3 control-label"><?= T_('Server Address') ?></label>
|
||||
<div class="col-sm-9">
|
||||
@@ -33,7 +39,15 @@
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><?= T_("Certificates") ?></h3>
|
||||
</div>
|
||||
|
||||
<div style="padding: 14px 14px 0 10px">
|
||||
<div class="form-group">
|
||||
<label for="crt_client" class="col-sm-3 control-label"><?= T_('Update Client Cert.') ?></label>
|
||||
<div class="input-group col-sm-9" style="padding: 0 15px">
|
||||
@@ -44,7 +58,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="crt_client_key" class="col-sm-3 control-label"><?= T_('Update Client Cert. Key') ?></label>
|
||||
<label for="crt_client_key" class="col-sm-3 control-label"><?= T_('Update Client Key') ?></label>
|
||||
<div class="input-group col-sm-9" style="padding: 0 15px">
|
||||
<input id="crt_client_key" name="crt_client_key" type="file" style="display: none" />
|
||||
<input type="text" class="form-control fileinput" id="crt_client_key_choosertxt" placeholder="-----BEGIN PRIVATE KEY-----" readonly="readonly" />
|
||||
@@ -60,9 +74,11 @@
|
||||
<a class="btn input-group-addon fileinput" id="crt_server_ca_chooserbtn"><?= T_('Browse') ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-xs-offset-3 col-sm-9">
|
||||
<div style="text-align: center">
|
||||
<button type="submit" class="btn btn-default" data-toggle="tooltip" data-title="<?= T_('Reloading may take a few minutes. Be patient.') ?>"><?= T_('Save and reload') ?></button>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user