From 5a5f3acce9cd7fc6a40cd273c19ee8f28778737f Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Sun, 11 Aug 2013 17:09:03 +0200 Subject: [PATCH] Generating lease-file location based on config file. Place it on OpenWRT into /tmp => memory --- CHANGELOG | 2 +- Makefile | 1 + piratebox/piratebox/bin/generate_config_files.sh | 2 +- piratebox/piratebox/conf/piratebox.conf | 4 ++++ 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 3d468b4..182faf9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,5 +9,5 @@ NOTE: This may only be a partial changelog, check github / your package manager * [New] install dependencies * [Fixed] General cleaning * [Fixed] Hide dot files in directory-listing which are usually hidden files - +* [New] Moved DHCP leasefile into memory on OpenWRT system (/tmp is memory) diff --git a/Makefile b/Makefile index 6c406dd..06195f4 100644 --- a/Makefile +++ b/Makefile @@ -48,6 +48,7 @@ $(OPENWRT_CONFIG_FOLDER): sed 's:DNSMASQ_INTERFACE="wlan0":DNSMASQ_INTERFACE="br-lan":' -i $@/piratebox.conf sed 's:192.168.77:192.168.1:g' -i $@/piratebox.conf sed 's:DROOPY_USE_USER="yes":DROOPY_USE_USER="no":' -i $@/piratebox.conf + sed 's:LEASE_FILE_LOCATION=$PIRATEBOX_FOLDER/tmp/lease.file:LEASE_FILE_LOCATION=/tmp/lease.file:' -i $@/piratebox.conf $(OPENWRT_BIN_FOLDER): mkdir -p $@ diff --git a/piratebox/piratebox/bin/generate_config_files.sh b/piratebox/piratebox/bin/generate_config_files.sh index 94ac288..52e4aa9 100755 --- a/piratebox/piratebox/bin/generate_config_files.sh +++ b/piratebox/piratebox/bin/generate_config_files.sh @@ -45,7 +45,7 @@ set_pathnames() { DEFAULT_HOSTS=$CONFIG_PATH/hosts DEFAULT_DNSMASQ=$CONFIG_PATH/dnsmasq_default.conf RADVD_CONFIG=$CONFIG_PATH/radvd_generated.conf - LEASE_FILE=$1/tmp/leases + LEASE_FILE=$LEASE_FILE_LOCATION LIGHTTPD_ENV_CONFIG=$CONFIG_PATH/lighttpd/env } diff --git a/piratebox/piratebox/conf/piratebox.conf b/piratebox/piratebox/conf/piratebox.conf index 5d55e1a..892164b 100644 --- a/piratebox/piratebox/conf/piratebox.conf +++ b/piratebox/piratebox/conf/piratebox.conf @@ -97,6 +97,10 @@ END_LEASE=250 #Leasetime (When should the client renew it's IP) LEASE_DURATION=12h +# Where is the leasefile stored to? +LEASE_FILE_LOCATION=$PIRATEBOX_FOLDER/tmp/lease.file + + # Define the netmask NETMASK=255.255.255.0