|
@ -88,26 +88,41 @@ prepare_host() { |
|
|
[ "$2" != "$n" ] && return 1 |
|
|
[ "$2" != "$n" ] && return 1 |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
HOST_CONF_FILE="$TMP_TINC/$n/hosts/$s" |
|
|
|
|
|
MANDATORY_PARAM_IN_UCI=0 |
|
|
|
|
|
[ ! -f "/etc/tinc/$n/hosts/$s" ] && { |
|
|
|
|
|
config_get pk "$s" "PublicKey" |
|
|
|
|
|
config_get na "$s" "Name" |
|
|
|
|
|
if [ -n "$pk" -a -n "$na" ] ; then |
|
|
|
|
|
HOST_CONF_FILE="$TMP_TINC/$n/hosts/$na" |
|
|
|
|
|
MANDATORY_PARAM_IN_UCI=1 |
|
|
|
|
|
fi |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
# host disabled? |
|
|
# host disabled? |
|
|
section_enabled "$s" || { |
|
|
section_enabled "$s" || { |
|
|
[ -f "$TMP_TINC/$n/hosts/$s" ] && rm "$TMP_TINC/$n/hosts/$s" |
|
|
|
|
|
|
|
|
[ -f "$HOST_CONF_FILE" ] && rm "$HOST_CONF_FILE" |
|
|
return 1 |
|
|
return 1 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[ ! -f "/etc/tinc/$n/hosts/$s" ] && { |
|
|
[ ! -f "/etc/tinc/$n/hosts/$s" ] && { |
|
|
echo -n "tinc: Warning, public key for $s for network $n " |
|
|
|
|
|
echo -n "missing in /etc/tinc/$n/hosts/$s, " |
|
|
|
|
|
echo "skipping configuration of $s" |
|
|
|
|
|
return 1 |
|
|
|
|
|
|
|
|
if [ "$MANDATORY_PARAM_IN_UCI" -eq 1 ] ; then |
|
|
|
|
|
touch "$HOST_CONF_FILE" ; |
|
|
|
|
|
else |
|
|
|
|
|
echo -n "tinc: Warning, public key for $s for network $n " |
|
|
|
|
|
echo -n "missing in /etc/tinc/$n/hosts/$s, " |
|
|
|
|
|
echo "skipping configuration of $s" |
|
|
|
|
|
return 1 |
|
|
|
|
|
fi |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
# append flags |
|
|
# append flags |
|
|
append_conf_bools "$s" "$TMP_TINC/$n/hosts/$s" \ |
|
|
|
|
|
|
|
|
append_conf_bools "$s" "$HOST_CONF_FILE" \ |
|
|
ClampMSS IndirectData PMTUDiscovery TCPOnly |
|
|
ClampMSS IndirectData PMTUDiscovery TCPOnly |
|
|
|
|
|
|
|
|
# append params |
|
|
# append params |
|
|
append_conf_params "$s" "$TMP_TINC/$n/hosts/$s" \ |
|
|
|
|
|
Address Cipher Compression Digest MACLength PMTU \ |
|
|
|
|
|
|
|
|
append_conf_params "$s" "$HOST_CONF_FILE" \ |
|
|
|
|
|
Address Cipher Compression Digest Ed25519PublicKey MACLength Name PMTU \ |
|
|
Port PublicKey PublicKeyFile Subnet |
|
|
Port PublicKey PublicKeyFile Subnet |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|