ocserv: silence warnings and set group default value
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
This commit is contained in:
parent
e4fe3cd093
commit
3558865a6e
1 changed files with 3 additions and 4 deletions
|
@ -37,7 +37,7 @@ setup_config() {
|
||||||
test $auth = "plain" && authsuffix="\[passwd=/var/etc/ocpasswd\]"
|
test $auth = "plain" && authsuffix="\[passwd=/var/etc/ocpasswd\]"
|
||||||
|
|
||||||
dyndns="false"
|
dyndns="false"
|
||||||
hostname=`uci show ddns|grep domain|head -1|cut -d '=' -f 2 2>/dev/null`
|
hostname=`uci show ddns 2>/dev/null|grep domain|head -1|cut -d '=' -f 2`
|
||||||
[ -n "$hostname" ] && dyndns="true"
|
[ -n "$hostname" ] && dyndns="true"
|
||||||
|
|
||||||
mkdir -p /var/etc
|
mkdir -p /var/etc
|
||||||
|
@ -67,10 +67,9 @@ setup_users() {
|
||||||
local password
|
local password
|
||||||
|
|
||||||
config_get name $1 name
|
config_get name $1 name
|
||||||
config_get group $1 group
|
config_get group $1 group '*'
|
||||||
config_get password $1 password
|
config_get password $1 password
|
||||||
|
|
||||||
[ -z "$group" ] && group='*'
|
|
||||||
[ -z "$name" -o -z "$password" ] && return
|
[ -z "$name" -o -z "$password" ] && return
|
||||||
|
|
||||||
echo "$name:$group:$password" >> /var/etc/ocpasswd
|
echo "$name:$group:$password" >> /var/etc/ocpasswd
|
||||||
|
@ -100,7 +99,7 @@ setup_dns() {
|
||||||
start() {
|
start() {
|
||||||
local hostname iface
|
local hostname iface
|
||||||
|
|
||||||
hostname=`uci show ddns|grep domain|head -1|cut -d '=' -f 2 2>/dev/null`
|
hostname=`uci show ddns 2>/dev/null|grep domain|head -1|cut -d '=' -f 2`
|
||||||
[ -z "$hostname" ] && hostname=`uci get system.@system[0].hostname 2>/dev/null`
|
[ -z "$hostname" ] && hostname=`uci get system.@system[0].hostname 2>/dev/null`
|
||||||
|
|
||||||
[ -f /etc/config/ocserv-dir/ca-key.pem ] && mv /etc/config/ocserv-dir/ca-key.pem /etc/ocserv/ca-key.pem
|
[ -f /etc/config/ocserv-dir/ca-key.pem ] && mv /etc/config/ocserv-dir/ca-key.pem /etc/ocserv/ca-key.pem
|
||||||
|
|
Loading…
Reference in a new issue