Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalwareutils.git;a=commitdiff;h=f9d905c5abb835917c9efd1c2a5b38c899566aa2

commit f9d905c5abb835917c9efd1c2a5b38c899566aa2
Author: James Buren <[email protected]>
Date:   Fri Apr 6 00:33:34 2012 -0500

netconfig: stop and start during suspend/resume

diff --git a/Makefile b/Makefile
index 5ae0ace..6e65f4c 100644
--- a/Makefile
+++ b/Makefile
@@ -60,8 +60,10 @@ install:
$(INSTALL) -d $(DESTDIR)$(sysconfdir)/sysconfig/network
$(INSTALL) -d $(DESTDIR)$(sysconfdir)/systemd/system/sysinit.target.wants
$(INSTALL) -d $(DESTDIR)$(libdir)/systemd/system
+       $(INSTALL) -d $(DESTDIR)/usr/lib/pm-utils/sleep.d
$(INSTALL) -m644 netconfig/netconfig.service 
$(DESTDIR)$(libdir)/systemd/system/netconfig.service
$(INSTALL) -m644 netconfig/netconfig-wait-online.service 
$(DESTDIR)$(libdir)/systemd/system/netconfig-wait-online.service
+       $(INSTALL) -m755 netconfig/netconfig.sleep 
$(DESTDIR)/usr/lib/pm-utils/sleep.d/55netconfig
$(INSTALL) -d $(DESTDIR)$(mandir)/man1
$(INSTALL) -d $(DESTDIR)$(mandir)/man3
$(INSTALL) -d $(DESTDIR)$(includedir)
diff --git a/netconfig/netconfig.sleep b/netconfig/netconfig.sleep
new file mode 100644
index 0000000..5432135
--- /dev/null
+++ b/netconfig/netconfig.sleep
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+. "${PM_FUNCTIONS}"
+
+# No point in proceeding if netconfig is not active.
+if ! systemctl is-active netconfig.service &> /dev/null; then
+  exit $NA
+fi
+
+case "$1" in
+       hibernate|suspend)
+               systemctl stop netconfig.service
+               ;;
+       thaw|resume)
+               systemctl start netconfig.service
+               ;;
+       *) exit $NA
+               ;;
+esac
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to