[Berlin-wireless] S70freifunkmap
    Marco Tidow 
    martidow
                  
    Di Jun 12 03:29:57 CEST 2007
    
    
On Sun, Jun.10. 11:26 +0200, Stefan Sperling wrote:
> Und /etc/init.d/S70freifunkmap kann das auch gebrauchen:
> 
> 	update () {
> 		# only one instance should be running at time
> 		# if exists an other one kill them and all wgets
> 		pid=`cat /tmp/freifunkmap.pid 2> /dev/null`
> 		if [ ! -z $pid ]; then
> 		       kill $pid >/dev/null 2> /dev/null
> 		       killall wget
> 		fi
> 
hab diese stelle so gefixt, ja nicht 100% wasserdicht, streng genommen.
update () {
  # only one instance should be running at time
  # if exists an other one kill them and all wgets
  pid="$(cat /tmp/freifunkmap.pid 2>/dev/null)"
  if [ ! -z $pid ]; then
    kill $pid >/dev/null 2> /dev/null
  fi
  # get rid of wget-s hanging arround
    for f in /proc/*/cmdline; do
      if grep -sq '^wget .*/mygooglemapscoords.txt' "$f"; then
        WGET_PID="${f#/proc/}"; WGET_PID="${WGET_PID%%/*}"
        kill "${WGET_PID}" 2>/dev/null
      fi
    done
[...]
locking finde ich hier bißchen übertrieben
Gruß, marco
    
    
Mehr Informationen über die Mailingliste Berlin