logo

widrop

[mirror] WiDrop distribution, now defunct
commit: e4ef887ca4ac3539eaa88aabd23de4051ff0b329
parent b9b2b1205e97279d03b7cde8c0d2c2a81f76ceba
Author: Mathieu Goessens <geb@breizh-entropy.org>
Date:   Mon, 22 Jul 2013 20:17:55 +0200

don't use cat foobar >> config in postinst

Diffstat:

Dsrc/pkg/widrop-common/DEBIAN/interfaces11-----------
Msrc/pkg/widrop-common/DEBIAN/postinst17++++++++++++++++-
Dsrc/pkg/widrop-hostapd/DEBIAN/hostapd4----
Msrc/pkg/widrop-hostapd/DEBIAN/postinst10+++++++++-
4 files changed, 25 insertions(+), 17 deletions(-)

diff --git a/src/pkg/widrop-common/DEBIAN/interfaces b/src/pkg/widrop-common/DEBIAN/interfaces @@ -1,11 +0,0 @@ -# BEGIN WIDROP -# DO NOT REMOVE THE BEGIN & END LINE -auto wlan0 -iface wlan0 inet static - address 10.42.0.1 - netmask 255.255.255.0 -# post-up /etc/init.d/hostapd restart - hostapd /etc/hostapd.conf - post-up /etc/init.d/dnsmasq restart - post-up /etc/iptables.sh -# END WIDROP diff --git a/src/pkg/widrop-common/DEBIAN/postinst b/src/pkg/widrop-common/DEBIAN/postinst @@ -1,5 +1,20 @@ #!/bin/sh +interface=$(cat <<EOF +# BEGIN WIDROP +# DO NOT REMOVE THE BEGIN & END LINE +auto wlan0 +iface wlan0 inet static + address 10.42.0.1 + netmask 255.255.255.0 +# post-up /etc/init.d/hostapd restart + hostapd /etc/hostapd.conf + post-up /etc/init.d/dnsmasq restart + post-up /etc/iptables.sh +# END WIDROP +EOF +) + case $1 in "configure") @@ -28,7 +43,7 @@ case $1 in sed s/^/#/ interfaces >> /etc/network/interfaces fi; - cat interfaces >> /etc/network/interfaces + echo $interfaces >> /etc/network/interfaces ;; esac diff --git a/src/pkg/widrop-hostapd/DEBIAN/hostapd b/src/pkg/widrop-hostapd/DEBIAN/hostapd @@ -1,4 +0,0 @@ -# BEGIN WIDROP -# DO NOT REMOVE THE BEGIN & END LINE -DAEMON_CONF="/etc/hostapd.conf" -# END WIDROP diff --git a/src/pkg/widrop-hostapd/DEBIAN/postinst b/src/pkg/widrop-hostapd/DEBIAN/postinst @@ -1,5 +1,13 @@ #!/bin/sh +hostapd=$(cat <<EOF +# BEGIN WIDROP +# DO NOT REMOVE THE BEGIN & END LINE +DAEMON_CONF="/etc/hostapd.conf" +# END WIDROP +EOF +) + case $1 in "configure") @@ -10,7 +18,7 @@ case $1 in echo exit 0 fi - cat hostapd >> /etc/default/hostapd + echo $hostapd >> /etc/default/hostapd ;; esac