package: fixes for uci config and init script

This commit is contained in:
Daniel Golle 2016-08-23 12:52:19 +02:00
parent f571f4b2f7
commit ec1fea6930
2 changed files with 13 additions and 6 deletions

View File

@ -2,7 +2,11 @@ config wtp
option country 'DE'
option location 'Magdeburg'
option name 'wtp-ap'
option ca '/etc/wtp/ca.crt'
option cert '/etc/wtp/wtp.crt'
option key '/etc/wtp/wtp.key'
option host '127.0.0.1'
# either use DTLS with ca, cert and key
# option ca '/etc/wtp/ca.crt'
# option cert '/etc/wtp/wtp.crt'
# option key '/etc/wtp/wtp.key'
# or PSK
# option identity 'myname'
# option psk 'verysecret'

View File

@ -87,12 +87,12 @@ wtp_conf_x509() {
if [ "$psk" -o "$identity" ]; then
echo " presharedkey: {"
echo " identity = \"${identity}\";"
echo " pskkey = \"123456\";"
echo " pskkey = \"${psk}\";"
echo " };"
fi
if [ "$ca" -o "$cert" -o "$key" ]; then
echo " x509: {"
echo " calist = \"$ca\";"
echo " calist = \"${ca}\";"
echo " certificate = \"${cert}\";"
echo " privatekey = \"${key}\";"
echo " };"
@ -103,6 +103,7 @@ wtp_conf_x509() {
wtp_conf_wlan() {
apx=0
cat <<EOF
wlan: {
prefix = "ap";
@ -117,6 +118,7 @@ EOF
else
mode="a"
fi
[ 1 -eq $apx ] && echo ","
cat <<EOF
{
device = "${phy}";
@ -202,6 +204,7 @@ EOF
};
}
EOF
apx=1
done
echo " );"
echo