|
@@ -53,14 +53,14 @@ setup_config() {
|
53
|
53
|
ipv6_addr=`echo $ip6addr|cut -d '/' -f 1`
|
54
|
54
|
ipv6_prefix=`echo $ip6addr|cut -d '/' -f 2`
|
55
|
55
|
|
56
|
|
- test $auth = "plain" && authsuffix="[/var/etc/ocpasswd]"
|
|
56
|
+ test $auth = "plain" && authsuffix="\[/var/etc/ocpasswd\]"
|
57
|
57
|
|
58
|
58
|
mkdir -p /var/etc
|
59
|
59
|
sed -e "s/|PORT|/$port/g" \
|
60
|
60
|
-e "s/|MAX_CLIENTS|/$max_clients/g" \
|
61
|
61
|
-e "s/|MAX_SAME|/$max_same/g" \
|
62
|
62
|
-e "s/|DPD|/$dpd/g" \
|
63
|
|
- -e "s/|AUTH|/$auth$authsuffix/g" \
|
|
63
|
+ -e "s#|AUTH|#$auth$authsuffix#g" \
|
64
|
64
|
-e "s/|PREDICTABLE_IPS|/$predictable_ips/g" \
|
65
|
65
|
-e "s/|CISCO_COMPAT|/$cisco_compat/g" \
|
66
|
66
|
-e "s/|UDP|/$udp/g" \
|
|
@@ -74,14 +74,17 @@ setup_config() {
|
74
|
74
|
|
75
|
75
|
setup_users() {
|
76
|
76
|
local name
|
|
77
|
+ local group
|
77
|
78
|
local password
|
78
|
79
|
|
79
|
80
|
config_get name $1 name
|
|
81
|
+ config_get group $1 group
|
80
|
82
|
config_get password $1 password
|
81
|
83
|
|
|
84
|
+ [ -z "$group" ] && group='*'
|
82
|
85
|
[ -z "$name" -o -z "$password" ] && return
|
83
|
86
|
|
84
|
|
- echo "$password"|ocpasswd -c /var/etc/ocpasswd "$name"
|
|
87
|
+ echo "$name:$group:$password" >> /var/etc/ocpasswd
|
85
|
88
|
}
|
86
|
89
|
|
87
|
90
|
setup_routes() {
|
|
@@ -165,6 +168,7 @@ start() {
|
165
|
168
|
|
166
|
169
|
rm -f /var/etc/ocpasswd
|
167
|
170
|
touch /var/etc/ocpasswd
|
|
171
|
+ chmod 600 /var/etc/ocpasswd
|
168
|
172
|
config_foreach setup_users ocservusers
|
169
|
173
|
|
170
|
174
|
setup_firewall config
|