Skip to content

Commit 3e27cfe

Browse files
author
Dmitry Shurupov
committed
merged all the fixes/features done by Vladimir Ipatov; tiny docs fixes
2 parents 3336714 + 84a7ba3 commit 3e27cfe

File tree

15 files changed

+192
-23
lines changed

15 files changed

+192
-23
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
debian/files
2+
debian/netgwm.debhelper.log
3+
debian/netgwm.postinst.debhelper
4+
debian/netgwm.prerm.debhelper
5+
debian/netgwm.substvars
6+
debian/netgwm/
7+
stamp
8+

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,11 @@ install:
77
install -d $(DESTDIR)/usr/lib/netgwm/
88
install -d $(DESTDIR)/var/lib/netgwm/
99
install -d $(DESTDIR)/etc/netgwm/
10+
install -d $(DESTDIR)/etc/init.d/
11+
install -d $(DESTDIR)/etc/default/
12+
install -d $(DESTDIR)/usr/sbin/
1013
cp -r $(CURDIR)/samples/* $(DESTDIR)/etc/netgwm/
1114
install $(CURDIR)/netgwm.py $(DESTDIR)/usr/lib/netgwm/netgwm.py
15+
install $(CURDIR)/netgwm.init.d $(DESTDIR)/etc/init.d/netgwm
16+
install $(CURDIR)/netgwm.default $(DESTDIR)/etc/default/netgwm
17+
install $(CURDIR)/netgwm $(DESTDIR)/usr/sbin/netgwm

README

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ network gateway when your current ISP goes offline.
77
How to deploy NetGWM?
88
0) Install prerequisites:
99
- iproute2
10+
- conntrack (http://conntrack-tools.netfilter.org/)
1011
- python-yaml (http://pyyaml.org/)
1112
1) Execute "make install". It will create /usr/lib/netgwm
1213
with netgwm.py and /etc/netgwm with configs and samples.
@@ -15,8 +16,9 @@ How to deploy NetGWM?
1516
their priorities.
1617
3) Add new routing table named "netgwm_check" to your iproute
1718
configuration file (/etc/iproute2/rt_tables; there is
18-
an example at samples/rt_tables.sample).
19-
4) Add netgwm.py to the crontab (samples/crontab.sample).
19+
an example at samples/rt_tables.sample). It's done
20+
automatically in the Debian package.
21+
4) Use /etc/init.d/netgwm to launch NetGWM.
2022

2123
That's all! NetGWM will ping given addresses through your
2224
current gateway to check your Internet connection. If all

debian/changelog

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
netgwm (0.3+sci1) unstable; urgency=low
2+
3+
* More automated install
4+
* Gateway switch logging
5+
* Fix crash when DNS resolving fails
6+
* Add init.d script
7+
* Add postchange hook to reset all UDP streams
8+
9+
-- Vladimir Ipatov <vs@ipatov.net> Sat, 6 Jun 2013 01:35:30 +0400
10+
111
netgwm (0.2-changeme4) changeme; urgency=low
212

313
* Fixed readme and doc

debian/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ Homepage: http://www.flant.ru
88

99
Package: netgwm
1010
Architecture: all
11-
Depends: ${misc:Depends}, python-yaml, python-minimal
11+
Depends: ${misc:Depends}, python-yaml, python-minimal, conntrack
1212
Description: change uplink
1313
monitor uplink and change gateway

debian/postinst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
rt_tables="/etc/iproute2/rt_tables"
4+
if !(cat "$rt_tables"|grep -q netgwm_check) then
5+
echo "194 netgwm_check" >> "$rt_tables"
6+
fi
7+
8+
invoke-rc.d netgwm start
9+

debian/postrm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
rt_tables="/etc/iproute2/rt_tables"
4+
if (cat "$rt_tables"|grep -q netgwm_check) then
5+
sed -i '/netgwm_check/d' "$rt_tables"
6+
fi
7+

debian/prerm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
invoke-rc.d netgwm stop

netgwm

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
. /etc/default/netgwm
4+
5+
echo $$ > /var/run/netgwm.pid
6+
7+
while true; do
8+
/usr/lib/netgwm/netgwm.py
9+
sleep $INTERVAL
10+
done

netgwm.default

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Defaults for netgwm initscript
2+
# sourced by /etc/init.d/netgwm
3+
# installed at /etc/default/netgwm by the maintainer scripts
4+
5+
# Start service on boot?
6+
START=no
7+
8+
# gateway check interval
9+
INTERVAL=5
10+
11+

0 commit comments

Comments
 (0)