Projekt

Obecné

Profil

« Předchozí | Další » 

Revize dbe1edf3

Přidáno uživatelem Michal Kliment před více než 3 roky(ů)

Drop Debian lenny support (fix #1161)

Zobrazit rozdíly:

freenetis-dhcp-sync.sh
TMPFILE=`mktemp`
echo "[INFO] `date -R` Downloading ISC DHCP SERVER config from (${PATH_FN})"
if [ "$DEBIAN_VERSION" = lenny ]; then # lenny wget -q DO NOT WORK :-(
status=`wget --no-check-certificate --server-response "$DOWN_PATH" -O "$TMPFILE" 2>&1 | awk '/^ HTTP/{print $2}'`
else
status=`wget --no-check-certificate --server-response -q "$DOWN_PATH" -O "$TMPFILE" 2>&1 | awk '/^ HTTP/{print $2}'`
fi
status=`wget --no-check-certificate --server-response -q "$DOWN_PATH" -O "$TMPFILE" 2>&1 | awk '/^ HTTP/{print $2}'`
# make sure that config exist
touch "$DHCP_CONF"
......
#restart DHCP server
echo "[INFO] `date -R` Restarting ISC DHCP server"
if [ "$DEBIAN_VERSION" = lenny ]; then # lenny do not have ISC
/etc/init.d/dhcp3-server restart 2>&1 >/dev/null
else # squeeze, wheezy, ...
service isc-dhcp-server restart 2>&1 >/dev/null
fi
service isc-dhcp-server restart 2>&1 >/dev/null
else
echo "[INFO] `date -R` No change -> keeping old configuration"
fi
freenetis-dhcp.lenny.conf
################################################################################
# #
# Author: Michal Kliment, Ondrej Fibich #
# Description: This script generates config file of DHCP3 server #
# from FreenetIS. #
# #
################################################################################
# Base PATH_FN to running FreenetIS instance
PATH_FN=http://localhost/freenetis
# ID of device from FreenetIS
DEVICE_ID=0
# Timeout in seconds after that the synchronization is made
TIMEOUT=300
# Log file, change to /dev/null to disable logging
LOG_FILE=/var/log/freenetis-dhcp.log
# Filename with ISC DHCP server config
DHCP_CONF="/etc/dhcp3/dhcpd.conf"
# This file (if exists) is attached to generated DHCP conf file
CUSTOM_DHCP_CONF="/etc/dhcp3/dhcpd.conf.custom"
# Full path [DO NOT CHANGE THIS VARIABLE!!!]
FULL_PATH=$PATH_FN"/index.php/en/devices/export/"$DEVICE_ID"/debian-etc-dhcp-dhcpd/text"
# Debian version for init script
DEBIAN_VERSION=lenny

Také k dispozici: Unified diff