source: MondoRescue/branches/2.2.9/mindi-busybox/examples/var_service/dhcp_if_pinger/run@ 2725

Last change on this file since 2725 was 2725, checked in by Bruno Cornec, 13 years ago
  • Update mindi-busybox to 1.18.3 to avoid problems with the tar command which is now failing on recent versions with busybox 1.7.3
  • Property svn:executable set to *
File size: 571 bytes
Line 
1#!/bin/sh
2
3delay=67
4
5if=${PWD##*/dhcp_}
6if=${if%%_pinger}
7
8if test -f "$0.log"; then
9 tail -999 "$0.log" >"$0.log.new"
10 mv "$0.log.new" "$0.log"
11fi
12
13test -f "/var/service/dhcp_$if/dhcp_$if.out" || exec env - sleep "$delay"
14. "/var/service/dhcp_$if/dhcp_$if.out"
15test x"$router" != x"" || exec env - sleep "$delay"
16
17#echo "`date '+%Y-%m-%d %H:%M:%S'` Testing ping -c3 $router" >>"$0.log"
18ping -c3 "$router" && exec env - sleep "$delay"
19
20echo "`date '+%Y-%m-%d %H:%M:%S'` Restarting /var/service/dhcp_$if" >>"$0.log"
21sv t "/var/service/dhcp_$if"
22
23exec env - sleep "$delay"
Note: See TracBrowser for help on using the repository browser.