Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 1897

Přidáno uživatelem Ondřej Fibich před více než 11 roky(ů)

freenetis-dhcp_0.1.2
- podpora pro debian lenny
- oprava chyb v sablone debconfu
- dalsi drobne opravy

Zobrazit rozdíly:

freenetis/branches/1.1/application/vendors/deb/freenetis-dhcp/control
Priority: optional
Section: web
Pre-Depends: debconf (>= 0.5) | debconf-2.0
Depends: coreutils, wget, isc-dhcp-server, diffutils, procps
Suggests: freenetis
Architecture: all
Maintainer: Ondrej Fibich <ondrej.fibich@gmail.com>
freenetis/branches/1.1/application/vendors/deb/freenetis-dhcp/prerm
NAME=freenetis-dhcp
# stop daemon
set +e
/etc/init.d/$NAME stop
set -e
#DEBHELPER#
freenetis/branches/1.1/application/vendors/deb/freenetis-dhcp/changelog
freenetis-dhcp (0.1.0) stable; urgency=low
* First release
-- Ondrej Fibich <ondrej.fibich@gmail.com> Wed, 16 Jan 2013 19:29:49 +0100
freenetis-dhcp (0.1.1) stable; urgency=hight
* Fix release
-- Ondrej Fibich <ondrej.fibich@gmail.com> Wed, 19 Jan 2013 19:21:49 +0100
freenetis-dhcp (0.1.2) stable; urgency=hight
* Adds dependency for killall
* Adds support for lenny
-- Ondrej Fibich <ondrej.fibich@gmail.com> Mon, 04 Mar 2013 19:15:04 +0100
freenetis/branches/1.1/application/vendors/deb/freenetis-dhcp/debianization.sh
# copy content of package ######################################################
cp ../../../dhcp/freenetis-dhcp.init.sh etc/init.d/${NAME}
cp ../../../dhcp/freenetis-dhcp-sync.sh usr/sbin/freenetis-dhcp-sync
cp ../../../dhcp/freenetis-dhcp.conf etc/freenetis/
if [ "$DEBIAN" = lenny ]; then
cp ../../../dhcp/freenetis-dhcp.lenny.conf etc/freenetis/freenetis-dhcp.conf
else
cp ../../../dhcp/freenetis-dhcp.conf etc/freenetis/freenetis-dhcp.conf
fi
# count size
SIZE=`du -s etc usr | cut -f1 | paste -sd+ | bc`
......
echo "Package: ${NAME}" >> DEBIAN/control
echo "Version: ${VERSION}-${DEBIAN}" >> DEBIAN/control
echo "Installed-Size: ${SIZE}" >> DEBIAN/control
if [ "$DEBIAN" = lenny ]; then
echo "Depends: coreutils, wget, dhcp3-server, diff, procps, psmisc" >> DEBIAN/control
else
echo "Depends: coreutils, wget, isc-dhcp-server, diffutils, procps, psmisc" >> DEBIAN/control
fi
cat ../../${NAME}/control >> DEBIAN/control
# change log
freenetis/branches/1.1/application/vendors/deb/freenetis-dhcp/templates
Default:
Description: Device ID:
ID of device from FreenetIS.
Description-cs.UTF-8: Vstupní rozhraní:
Description-cs.UTF-8: ID zařízení:
ID zařízení z FreenetISu.
Template: freenetis-dhcp/timeout
freenetis/branches/1.1/application/vendors/dhcp/freenetis-dhcp-sync.sh
# download
TMPFILE=`mktemp`
echo "[INFO] `date -R` Downloading ISC DHCP SERVER config from (${PATH_FN})"
status=`wget --no-check-certificate --server-response -q "$DOWN_PATH" -O "$TMPFILE" 2>&1 | awk '/^ HTTP/{print $2}'`
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
# make sure that config exist
touch "$DHCP_CONF"
......
mv -f "$TMPFILE" "$DHCP_CONF"
#restart DHCP server
echo "[INFO] `date -R` Restarting ISC DHCP server"
service isc-dhcp-server restart 2>&1 >/dev/null
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
else
echo "[INFO] `date -R` No change -> keeping old configuration"
fi
freenetis/branches/1.1/application/vendors/dhcp/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
freenetis/branches/1.1/application/vendors/dhcp/freenetis-dhcp.init.sh
cat /dev/null > "$LOG_FILE"
echo -n "Starting FreenetIS DHCP deamon: "
nohup $DHCP_SYNCFILE >> "$LOG_FILE" 2>&1 &
nohup "$DHCP_SYNCFILE" >> "$LOG_FILE" 2>&1 &
# test if daemon is started
if [ `ps aux | grep "$DHCP_SYNCFILE" | grep -v grep | wc -l` -gt 0 ];

Také k dispozici: Unified diff