Merge branch 'master' of 0xacab.org:pip/rap into master

This commit is contained in:
fauno 2020-09-18 16:24:30 -03:00
commit e8955c82bc
2 changed files with 4 additions and 4 deletions

View File

@ -29,7 +29,7 @@ event=${0##*/}; event=${event%-*}
state=${0##*/}; state=${state#*-}
# evitar que el script falle cuando no hay ningun script
type shopt &>/dev/null && shopt -s nullglob
type shopt >/dev/null && shopt -s nullglob
for _script in scripts/${event}-*; do
# si no hay nullglob va a llegar un archivo con * literal (ej. ash)

View File

@ -19,10 +19,10 @@ case $2 in
IP="${ULA_PREFIX}$(mac_to_address "${SUBNET}")"
;;
tinc)
MAC="$(cat "/sys/class/net/${INTERFACE}/address")"
IP="${ULA_PREFIX}$(mac_to_address "${MAC}")"
case $1 in
up)
MAC="$(cat "/sys/class/net/${INTERFACE}/address")"
IP="${ULA_PREFIX}$(mac_to_address "${MAC}")"
ip address add "${IP}/64" dev "${INTERFACE}"
;;
down)
@ -36,5 +36,5 @@ sed -re "/${NODE}\.${NETNAME} ${COMMENT}$/d" -i "${ETCHOSTS}"
sed -re "/^${IP} .* ${COMMENT}$/d" -i "${ETCHOSTS}"
if test "$1" = "up"; then
echo "${IP} ${NODE}.${NETNAME} ${COMMENT}" >> "${ETCHOSTS}"
echo "${IP} ${NODE}.${NETNAME} www.${NODE}.${NETNAME} ${COMMENT}" >> "${ETCHOSTS}"
fi