[arch-commits] Commit in ifplugd/trunk (PKGBUILD ifplugd)

2013-06-06 Thread Thomas Bächler
Date: Thursday, June 6, 2013 @ 20:34:30
  Author: thomas
Revision: 187833

upgpkg: ifplugd 0.28-14: remove rc.d script

Modified:
  ifplugd/trunk/PKGBUILD
Deleted:
  ifplugd/trunk/ifplugd

--+
 PKGBUILD |   12 ++
 ifplugd  |  105 -
 2 files changed, 4 insertions(+), 113 deletions(-)

Modified: PKGBUILD
===
--- PKGBUILD2013-06-06 18:31:08 UTC (rev 187832)
+++ PKGBUILD2013-06-06 18:34:30 UTC (rev 187833)
@@ -5,7 +5,7 @@
 
 pkgname=ifplugd
 pkgver=0.28
-pkgrel=13
+pkgrel=14
 pkgdesc=A daemon which brings up/down network interfaces upon cable 
insertion/removal.
 arch=('i686' 'x86_64')
 url=http://0pointer.de/lennart/projects/ifplugd;
@@ -13,17 +13,15 @@
 license=('GPL2')
 depends=('libdaemon' 'bash')
 backup=('etc/ifplugd/ifplugd.conf')
-options=('!makeflags')
+options=('!makeflags' '!emptydirs')
 source=($url/${pkgname}-${pkgver}.tar.gz
 ifplugd-0.28-interface.patch
 ifplugd-fix-return-value.patch
-ifplugd
 ifplugd-daemon
 ifplugd.systemd)
 md5sums=('df6f4bab52f46ffd6eb1f5912d4ccee3'
  '54eb22844b5aeed161c0b80aa9008570'
  'f26dbd7597d9d637f0b2b104b11ab820'
- '1ea9aa64415a5a9e27b84634cd08a7f2'
  'f2e8a37af52b79ee0e3c5bcc2470ce10'
  '3dc2ce45d0e12d155ecc7a5bc9e3ee04')
 
@@ -41,11 +39,9 @@
   cd ${srcdir}/${pkgname}-${pkgver}
   make DESTDIR=${pkgdir} install
 
-  # replace the default init script  action files with ours.
-  install -D -m755 ${srcdir}/ifplugd ${pkgdir}/etc/rc.d/ifplugd
   install -D -m755 ${srcdir}/ifplugd-daemon ${pkgdir}/usr/bin/ifplugd-daemon
-  # remove default action script
-  rm -f ${pkgdir}/etc/ifplugd/ifplugd.action
+  # remove the default init script and action script
+  rm -f ${pkgdir}/etc/{ifplugd/ifplugd.action,rc.d/ifplugd}
   # install systemd unit
   install -D -m644 ${srcdir}/ifplugd.systemd 
${pkgdir}/usr/lib/systemd/system/ifplugd@.service
 }

Deleted: ifplugd
===
--- ifplugd 2013-06-06 18:31:08 UTC (rev 187832)
+++ ifplugd 2013-06-06 18:34:30 UTC (rev 187833)
@@ -1,105 +0,0 @@
-#!/bin/bash
-#
-# ifplugd daemon script for Arch Linux
-
-. /etc/rc.conf
-. /etc/rc.d/functions
-
-shopt -s extglob
-
-# env vars
-daemonname=ifplugd
-cfg=/etc/ifplugd/ifplugd.conf
-PID=$(pidof -o %PPID ifplugd)
-
-# source configuration file
-[[ -r $cfg ]]  . $cfg
-
-# discover interfaces to monitor
-net_ifs=($INTERFACES)
-
-case $1 in
-  start)
-stat_busy Starting $daemonname: ${net_ifs[*]}
-
-for nic in ${net_ifs[@]}; do
-  # only start if a PID doesn't already exist
-  if [[ ! -f /var/run/ifplugd.$nic.pid ]]; then
-/usr/bin/ifplugd-daemon $nic
-
-# use presence of PID file to check for start success
-[[ -f /var/run/ifplugd.$nic.pid ]] || (( ++err ))
-  fi
-done
-unset nic
-
-if (( err )); then
-  stat_fail
-  exit 1
-else
-  add_daemon $daemonname
-  stat_done
-fi
-;;
-  stop)
-stat_busy Stopping $daemonname: ${net_ifs[*]}
-
-for nic in /var/run/ifplugd.*.pid; do
-  [[ -f $nic ]] || { (( ++err )); break; }
-  nic=${nic%.pid}
-  nic=${nic##*.}
-  ifplugd -k -i $nic || (( ++err ))
-done
-
-if (( err )); then
-  stat_fail
-  exit 1
-else
-  rm_daemon $daemonname
-  stat_done
-fi
-;;
-  restart)
-$0 stop
-sleep 1
-$0 start
-;;
-  status)
-for nic in ${net_ifs[@]}; do
-  ifplugd -c -i $nic
-done
-unset nic
-;;
-  suspend)
-stat_busy Suspending $daemonname: ${net_ifs[*]}
-for nic in ${net_ifs[@]}; do
-  ifplugd -S -i $nic || (( ++err ))
-done
-unset nic
-
-if (( err )); then
-  stat_fail
-  exit 1
-else
-  stat_done
-fi
-;;
-  resume)
-stat_busy Resuming $daemonname ${net_ifs[*]}
-
-for nic in ${net_ifs[@]}; do
-  ifplugd -R -i $nic || (( ++err ))
-done
-unset nic
-
-if (( err )); then
-  stat_fail
-  exit 1
-else
-  stat_done
-fi
-;;
-  *)
-echo usage: $0 {start|stop|restart|status|suspend|resume}
-esac
-exit 0



[arch-commits] Commit in ifplugd/trunk (PKGBUILD ifplugd)

2012-08-30 Thread Thomas Bächler
Date: Thursday, August 30, 2012 @ 05:37:21
  Author: thomas
Revision: 165790

upgpkg: ifplugd 0.28-13: Fix type in rc.d script

Modified:
  ifplugd/trunk/PKGBUILD
  ifplugd/trunk/ifplugd

--+
 PKGBUILD |4 ++--
 ifplugd  |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===
--- PKGBUILD2012-08-29 23:52:16 UTC (rev 165789)
+++ PKGBUILD2012-08-30 09:37:21 UTC (rev 165790)
@@ -5,7 +5,7 @@
 
 pkgname=ifplugd
 pkgver=0.28
-pkgrel=12
+pkgrel=13
 pkgdesc=A daemon which brings up/down network interfaces upon cable 
insertion/removal.
 arch=('i686' 'x86_64')
 url=http://0pointer.de/lennart/projects/ifplugd;
@@ -23,7 +23,7 @@
 md5sums=('df6f4bab52f46ffd6eb1f5912d4ccee3'
  '54eb22844b5aeed161c0b80aa9008570'
  'f26dbd7597d9d637f0b2b104b11ab820'
- '158bda9014eb35979af9b094feca5fe1'
+ '1ea9aa64415a5a9e27b84634cd08a7f2'
  'f2e8a37af52b79ee0e3c5bcc2470ce10'
  '3dc2ce45d0e12d155ecc7a5bc9e3ee04')
 

Modified: ifplugd
===
--- ifplugd 2012-08-29 23:52:16 UTC (rev 165789)
+++ ifplugd 2012-08-30 09:37:21 UTC (rev 165790)
@@ -24,7 +24,7 @@
 
 for nic in ${net_ifs[@]}; do
   # only start if a PID doesn't already exist
-  if [[ ! -f /var/run/ifplugd.$nic.pid ]];
+  if [[ ! -f /var/run/ifplugd.$nic.pid ]]; then
 /usr/bin/ifplugd-daemon $nic
 
 # use presence of PID file to check for start success



[arch-commits] Commit in ifplugd/trunk (PKGBUILD ifplugd)

2012-05-07 Thread Dave Reisner
Date: Monday, May 7, 2012 @ 05:54:01
  Author: dreisner
Revision: 158688

upgpkg: ifplugd 0.28-11

- use NET_IFS as basis in rc.d script

Modified:
  ifplugd/trunk/PKGBUILD
  ifplugd/trunk/ifplugd

--+
 PKGBUILD |4 ++--
 ifplugd  |6 --
 2 files changed, 6 insertions(+), 4 deletions(-)

Modified: PKGBUILD
===
--- PKGBUILD2012-05-07 08:43:27 UTC (rev 158687)
+++ PKGBUILD2012-05-07 09:54:01 UTC (rev 158688)
@@ -5,7 +5,7 @@
 
 pkgname=ifplugd
 pkgver=0.28
-pkgrel=10
+pkgrel=11
 pkgdesc=A daemon which brings up/down network interfaces upon cable 
insertion/removal.
 arch=('i686' 'x86_64')
 url=http://0pointer.de/lennart/projects/ifplugd;
@@ -15,7 +15,7 @@
 options=('!makeflags')
 source=($url/${pkgname}-${pkgver}.tar.gz 'ifplugd' 'ifplugd.action' 
'ifplugd-0.28-interface.patch' 'ifdown.01-route.sh' 'ifup.01-route.sh' 
'ifup.02-ntpdate.sh')
 md5sums=('df6f4bab52f46ffd6eb1f5912d4ccee3'
- 'ef27f40434ca85ccaf57a7e388eb001e'
+ '2281cd3eda9e3403857863e1a1bc00be'
  '6f98767c4ea2cf0580f73ced81efd21a'
  '54eb22844b5aeed161c0b80aa9008570'
  'd6ce6c7bd481a0b3944c944c5b277c0b'

Modified: ifplugd
===
--- ifplugd 2012-05-07 08:43:27 UTC (rev 158687)
+++ ifplugd 2012-05-07 09:54:01 UTC (rev 158688)
@@ -16,9 +16,11 @@
 [[ -r $cfg ]]  . $cfg
 
 # discover interfaces to monitor
-# (replacing INTERFACES with net_ifs, since AL
+# (replacing INTERFACES with NET_IFS, since AL
 # already uses it in /etc/rc.conf)
-if [[ -z $net_ifs ]]; then
+if [[ $NET_IFS ]]; then
+  net_ifs=($NET_IFS)
+else
   net_ifs=(/sys/class/net/!(lo))
   net_ifs=(${net_ifs[@]##*/})
 fi



[arch-commits] Commit in ifplugd/trunk (PKGBUILD ifplugd)

2012-04-28 Thread Dave Reisner
Date: Saturday, April 28, 2012 @ 14:49:33
  Author: dreisner
Revision: 157469

upgpkg: ifplugd 0.28-9

- fix a few latent bugs from ifplugd script testing

Modified:
  ifplugd/trunk/PKGBUILD
  ifplugd/trunk/ifplugd

--+
 PKGBUILD |   13 -
 ifplugd  |   41 +++--
 2 files changed, 27 insertions(+), 27 deletions(-)

Modified: PKGBUILD
===
--- PKGBUILD2012-04-28 17:53:35 UTC (rev 157468)
+++ PKGBUILD2012-04-28 18:49:33 UTC (rev 157469)
@@ -5,7 +5,7 @@
 
 pkgname=ifplugd
 pkgver=0.28
-pkgrel=8
+pkgrel=9
 pkgdesc=A daemon which brings up/down network interfaces upon cable 
insertion/removal.
 arch=('i686' 'x86_64')
 url=http://0pointer.de/lennart/projects/ifplugd;
@@ -14,10 +14,13 @@
 backup=('etc/ifplugd/ifplugd.conf' 'etc/ifplugd/ifplugd.action')
 options=('!makeflags')
 source=($url/${pkgname}-${pkgver}.tar.gz 'ifplugd' 'ifplugd.action' 
'ifplugd-0.28-interface.patch' 'ifdown.01-route.sh' 'ifup.01-route.sh' 
'ifup.02-ntpdate.sh')
-md5sums=('df6f4bab52f46ffd6eb1f5912d4ccee3' '70d66121ae5163348855236951e069a2'\
- 'e91a3d77d707ae79fbc10146848032dc' '54eb22844b5aeed161c0b80aa9008570'\
-'d6ce6c7bd481a0b3944c944c5b277c0b' 'c35f0a637911b747f8dc3bd3c6156a1b'\
-'f8690ee18a5ca7285ee96826c2cf')
+md5sums=('df6f4bab52f46ffd6eb1f5912d4ccee3'
+ 'ef27f40434ca85ccaf57a7e388eb001e'
+ '6f98767c4ea2cf0580f73ced81efd21a'
+ '54eb22844b5aeed161c0b80aa9008570'
+ 'd6ce6c7bd481a0b3944c944c5b277c0b'
+ 'c35f0a637911b747f8dc3bd3c6156a1b'
+ 'f8690ee18a5ca7285ee96826c2cf')
 
 build() {
   cd ${srcdir}/${pkgname}-${pkgver}

Modified: ifplugd
===
--- ifplugd 2012-04-28 17:53:35 UTC (rev 157468)
+++ ifplugd 2012-04-28 18:49:33 UTC (rev 157469)
@@ -10,7 +10,7 @@
 # env vars
 daemonname=ifplugd
 cfg=/etc/ifplugd/ifplugd.conf
-PID=$(pgrep -ox ifplugd)
+PID=$(pidof -o %PPID ifplugd)
 
 # source configuration file
 [[ -r $cfg ]]  . $cfg
@@ -18,24 +18,25 @@
 # discover interfaces to monitor
 # (replacing INTERFACES with net_ifs, since AL
 # already uses it in /etc/rc.conf)
-if [[ -z $net_ifs ]]; then 
+if [[ -z $net_ifs ]]; then
   net_ifs=(/sys/class/net/!(lo))
   net_ifs=(${net_ifs[@]##*/})
 fi
 
 case $1 in
   start)
-stat_busy Starting $daemonname
-if [[ $PID ]]; then
-  stat_fail
-  exit 1
-fi
+stat_busy Starting $daemonname: ${net_ifs[*]}
 
 for nic in ${net_ifs[@]}; do
-  args=ARGS_$nic
-  [[ -z ${!args} ]]  args=$ARGS || args=${!args}
-  ifplugd -i $nic $args || (( ++err ))
-  printf ' %s' $nic
+  # only start if a PID doesn't already exist
+  if [[ ! -f /var/run/ifplugd.$nic.pid ]]; then
+args=ARGS_$nic
+[[ -z ${!args} ]]  args=$ARGS || args=${!args}
+ifplugd -i $nic $args
+
+# use presence of PID file to check for start success
+[[ -f /var/run/ifplugd.$nic.pid ]] || (( ++err ))
+  fi
 done
 unset nic
 
@@ -48,15 +49,13 @@
 fi
 ;;
   stop)
-stat_busy Stopping $daemonname
-if [[ -z $PID ]]; then
-  stat_fail
-  exit 1
-fi
+stat_busy Stopping $daemonname: ${net_ifs[*]}
 
-for nic in ${net_ifs[@]}; do
+for nic in /var/run/ifplugd.*.pid; do
+  [[ -f $nic ]] || { (( ++err )); break; }
+  nic=${nic%.pid}
+  nic=${nic##*.}
   ifplugd -k -i $nic || (( ++err ))
-  printf ' %s' $nic
 done
 
 if (( err )); then
@@ -79,10 +78,9 @@
 unset nic
 ;;
   suspend)
-stat_busy Suspending $daemonname
+stat_busy Suspending $daemonname: ${net_ifs[*]}
 for nic in ${net_ifs[@]}; do
   ifplugd -S -i $nic || (( ++err ))
-  printf ' %s' $nic
 done
 unset nic
 
@@ -94,11 +92,10 @@
 fi
 ;;
   resume)
-stat_busy Resuming $daemonname
+stat_busy Resuming $daemonname ${net_ifs[*]}
 
 for nic in ${net_ifs[@]}; do
   ifplugd -R -i $nic || (( ++err ))
-  printf ' %s' $nic
 done
 unset nic