Only use the first instance
This commit is contained in:
parent
cae00d781f
commit
4bdcc04286
|
@ -660,17 +660,17 @@ function install_cjdns {
|
||||||
if [ $CJDNS_PRIVATE_KEY ]; then
|
if [ $CJDNS_PRIVATE_KEY ]; then
|
||||||
sed -i "s/\"privateKey\":.*/\"privateKey\": \"$CJDNS_PRIVATE_KEY\",/g" /etc/cjdns/cjdroute.conf
|
sed -i "s/\"privateKey\":.*/\"privateKey\": \"$CJDNS_PRIVATE_KEY\",/g" /etc/cjdns/cjdroute.conf
|
||||||
else
|
else
|
||||||
CJDNS_PRIVATE_KEY=$(cat /etc/cjdns/cjdroute.conf | grep '"privateKey"' | awk -F '"' '{print $4}')
|
CJDNS_PRIVATE_KEY=$(cat /etc/cjdns/cjdroute.conf | grep '"privateKey"' | awk -F '"' '{print $4}' | sed -n 1p)
|
||||||
fi
|
fi
|
||||||
if [ $CJDNS_PUBLIC_KEY ]; then
|
if [ $CJDNS_PUBLIC_KEY ]; then
|
||||||
sed -i "s/\"publicKey\":.*/\"publicKey\": \"$CJDNS_PUBLIC_KEY\",/g" /etc/cjdns/cjdroute.conf
|
sed -i "s/\"publicKey\":.*/\"publicKey\": \"$CJDNS_PUBLIC_KEY\",/g" /etc/cjdns/cjdroute.conf
|
||||||
else
|
else
|
||||||
CJDNS_PUBLIC_KEY=$(cat /etc/cjdns/cjdroute.conf | grep '"publicKey"' | awk -F '"' '{print $4}')
|
CJDNS_PUBLIC_KEY=$(cat /etc/cjdns/cjdroute.conf | grep '"publicKey"' | awk -F '"' '{print $4}' | sed -n 1p)
|
||||||
fi
|
fi
|
||||||
if [ $CJDNS_IPV6 ]; then
|
if [ $CJDNS_IPV6 ]; then
|
||||||
sed -i "s/\"ipv6\":.*/\"ipv6\": \"$CJDNS_IPV6\",/g" /etc/cjdns/cjdroute.conf
|
sed -i "s/\"ipv6\":.*/\"ipv6\": \"$CJDNS_IPV6\",/g" /etc/cjdns/cjdroute.conf
|
||||||
else
|
else
|
||||||
CJDNS_IPV6=$(cat /etc/cjdns/cjdroute.conf | grep '"ipv6"' | awk -F '"' '{print $4}')
|
CJDNS_IPV6=$(cat /etc/cjdns/cjdroute.conf | grep '"ipv6"' | awk -F '"' '{print $4}' | sed -n 1p)
|
||||||
fi
|
fi
|
||||||
if [ $CJDNS_PASSWORD ]; then
|
if [ $CJDNS_PASSWORD ]; then
|
||||||
sed -i "0,/{\"password\":.*/s//{\"password\": \"$CJDNS_PASSWORD\"}/g" /etc/cjdns/cjdroute.conf
|
sed -i "0,/{\"password\":.*/s//{\"password\": \"$CJDNS_PASSWORD\"}/g" /etc/cjdns/cjdroute.conf
|
||||||
|
@ -680,7 +680,7 @@ function install_cjdns {
|
||||||
if [ $CJDNS_PORT ]; then
|
if [ $CJDNS_PORT ]; then
|
||||||
sed -i "s/\"bind\": \"0.0.0.0:.*/\"bind\": \"0.0.0.0:$CJDNS_PORT\",/g" /etc/cjdns/cjdroute.conf
|
sed -i "s/\"bind\": \"0.0.0.0:.*/\"bind\": \"0.0.0.0:$CJDNS_PORT\",/g" /etc/cjdns/cjdroute.conf
|
||||||
else
|
else
|
||||||
CJDNS_PORT=$(cat /etc/cjdns/cjdroute.conf | grep '"bind": "0.0.0.0:' | awk -F '"' '{print $4}' | awk -F ':' '{print $2}')
|
CJDNS_PORT=$(cat /etc/cjdns/cjdroute.conf | grep '"bind": "0.0.0.0:' | awk -F '"' '{print $4}' | awk -F ':' '{print $2}' | sed -n 1p)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# endure that ipv6 is enabled and can route
|
# endure that ipv6 is enabled and can route
|
||||||
|
|
Loading…
Reference in New Issue