#!/bin/sh set -e # main [ "$1" = "pre-cpkg" ] || exit 0 # read vars # Establecemos las redes a las que no se debe cachear. # Primero: Obtenemos las diferentes interfaces del servidor SERVER_NETWORK_DEVICES_LIST="$(lliurex-net get_network_cards) $(lliurex-net get_alias)" SERVER_NETWORK_DEVICES_LIST="$(lliurex-net get_network_cards) $(lliurex-net get_alias)" SERVER_NETWORKS_NOT_CACHED="" for DEVICE in $SERVER_NETWORK_DEVICES_LIST ; do CURRENT_IP="$(lliurex-net get_current_ip $DEVICE)" CURRENT_MASK="$(lliurex-net get_current_bitmask $DEVICE)" CURRENT_NETWORK="$(lliurex-net ipcalc_network "$CURRENT_IP"/"$CURRENT_MASK")" if [ -n "$CURRENT_IP" ] ; then logger -t "llxcfg-proxy: $(basename $0)" "SERVER_NETWORKS_NOT_CACHED: Added $CURRENT_IP/$CURRENT_MASK" SERVER_NETWORKS_NOT_CACHED="$SERVER_NETWORKS_NOT_CACHED$CURRENT_NETWORK/$CURRENT_MASK\n" fi CURRENT_IP="" CURRENT_MASK="" done llxcfg-systemvars add SERVER_NETWORKS_NOT_CACHED="$(echo "$SERVER_NETWORKS_NOT_CACHED" |sort -u|tr "\n" " ")" echo "$SERVER_NETWORKS_NOT_CACHED" |sort -u | llxcfg-config write proxy/no-cache-networks/llxcfg-proxy.conf