Mail archive
alpine-aports

[alpine-aports] [PATCH] main/pingu: APKBUILD: fix pkgdesc & url, remove /var from package. Init-script: made some cleanups and rundir creation added.

From: Valery Kartel <valery.kartel_at_gmail.com>
Date: Thu, 24 Dec 2015 13:01:00 +0200

---
 main/pingu/APKBUILD    | 13 +++++++------
 main/pingu/pingu.initd | 22 +++++++++-------------
 2 files changed, 16 insertions(+), 19 deletions(-)
diff --git a/main/pingu/APKBUILD b/main/pingu/APKBUILD
index 8afe781..612f602 100644
--- a/main/pingu/APKBUILD
+++ b/main/pingu/APKBUILD
_at_@ -2,9 +2,9 @@
 # Maintainer: Natanael Copa <ncopa_at_alpinelinux.org>
 pkgname=pingu
 pkgver=1.5
-pkgrel=1
-pkgdesc="Small daemon that pings hosts and executes a script when status change"
-url="http://git.alpinelinux.org/cgit/pingu"
+pkgrel=2
+pkgdesc="Policy routing daemon with failover and load-balancing for multi ISP setups"
+url="http://git.alpinelinux.org/cgit/hosted/pingu/about"
 arch="all"
 license="GPL"
 makedepends="libev-dev lua-dev asciidoc linux-headers"
_at_@ -51,6 +51,7 @@ package() {
 	make DESTDIR="$pkgdir" install install-lua
 	install -m644 -D pingu.conf "$pkgdir"/etc/pingu/pingu.conf
 	install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
+	rm -fr "$pkgdir"/var
 }
 
 mtu() {
_at_@ -66,8 +67,8 @@ _lua() {
 }
 
 md5sums="3454ef7723e446d917c389c0615c62b4  pingu-1.5.tar.gz
-dd46546d05395893a1624e467b04b1d4  pingu.initd"
+187efb0115af5a9c5e356b5028466bd3  pingu.initd"
 sha256sums="1caaef8765e7bd6950be8109a58187ad529237eec89742d923c1888f4c2a9f6d  pingu-1.5.tar.gz
-1d4388e96a257c0bc01a585df36c0e6bc6c1ba53c9bb0b67290eaff7e8a6d1b3  pingu.initd"
+ff29454b43a64783cd5c0c938bc3b7d7866ea6d59752a7dd1b4111e7420b2d4c  pingu.initd"
 sha512sums="71e5fbe93f831f24d168957cdeaff2817a22f407575316d6515755bec760d10724821070549eaab562924237b96976a1a776ca903d5fe0cd9f9b69a38eadd8c9  pingu-1.5.tar.gz
-93859ab4e84d07c776915045b3fe533de551c55465dab4aa283f5606c0e8a439875f91e0e1db419bc97b01f7e4c4b0f5d434885edcf9ad77e6f65f6f27715de8  pingu.initd"
+034051862fabf97cf1375ca9ac2f31ee9335eac2d94e0527cb541322ad6eb8b0de779c735cc5706cb941a3c43b672fe9baeac8fc18dbee74360e241101d1ae84  pingu.initd"
diff --git a/main/pingu/pingu.initd b/main/pingu/pingu.initd
index 517bdd8..34769f6 100644
--- a/main/pingu/pingu.initd
+++ b/main/pingu/pingu.initd
_at_@ -3,9 +3,9 @@
 description="MultiISP load balancing and failover"
 command=/usr/sbin/pingu
 command_args="-d $pingu_opts"
+cfgfile=/etc/pingu/pingu.conf
 pidfile=/var/run/pingu/pingu.pid
-route_rules=/etc/pingu/route-rules
-rundir=${pidfile%/*}
+required_files="$cfgfile"
 
 depend() {
 	need net
_at_@ -13,24 +13,20 @@ depend() {
 }
 
 start_pre() {
-	if ! [ -f "$route_rules" ]; then
-		return 0
-	fi
-	sed -e 's/\#.*//' -e '/^$/d' "$route_rules" | while read line; do
+	checkpath checkpath --directory ${pidfile%/*}
+	[ -f ${cfgfile%/*}/route-rules ] && \
+	sed -e 's/\#.*//' -e '/^$/d' ${cfgfile%/*}/route-rules | while read line; do
 		ebegin "Adding route rule: $line"
-		ip rule add $line && echo $line >> $rundir/route-rules
+		ip rule add $line && echo $line >> ${pidfile%/*}/route-rules
 		eend
 	done
 }
 
 stop_post() {
-	if ! [ -f "$rundir"/route-rules ]; then
-		return 0
-	fi
-	while read line; do
+	[ -f ${pidfile%/*}/route-rules ] && while read line; do
 		ebegin "Removing route rule: $line"
 		ip rule del $line
 		eend
-	done < "$rundir"/route-rules
-	rm "$rundir"/route-rules
+	done < ${pidfile%/*}/route-rules
+	rm -f ${pidfile%/*}/route-rules
 }
-- 
2.6.4
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Thu Dec 24 2015 - 13:01:00 GMT