|
| 1 | +diff -ruN vdr-addon-lifeguard-0.0.4/lifeguard.conf vdr-addon-lifeguard-0.0.4.patched/lifeguard.conf |
| 2 | +--- vdr-addon-lifeguard-0.0.4/lifeguard.conf 2010-10-02 02:38:45.000000000 +0200 |
| 3 | ++++ vdr-addon-lifeguard-0.0.4.patched/lifeguard.conf 2013-08-07 19:34:19.579593330 +0200 |
| 4 | +@@ -6,7 +6,7 @@ |
| 5 | + |
| 6 | + # standard entries |
| 7 | + usr |
| 8 | +-cmd aptitude Aptitude |
| 9 | ++cmd pacman Pacman |
| 10 | + tcp ssh SSH |
| 11 | + tcp nfs NFS\ Mount |
| 12 | + tcp ftp FTP |
| 13 | +diff -ruN vdr-addon-lifeguard-0.0.4/S91.lifeguard vdr-addon-lifeguard-0.0.4.patched/S91.lifeguard |
| 14 | +--- vdr-addon-lifeguard-0.0.4/S91.lifeguard 2010-10-02 02:38:45.000000000 +0200 |
| 15 | ++++ vdr-addon-lifeguard-0.0.4.patched/S91.lifeguard 2013-08-07 19:34:05.217094413 +0200 |
| 16 | +@@ -1,4 +1,4 @@ |
| 17 | +-#! /bin/sh |
| 18 | ++#! /bin/bash |
| 19 | + # |
| 20 | + # Given the types and search patterns in the configuration file, determine |
| 21 | + # whether there are any processes or network connections that should |
| 22 | +@@ -23,7 +23,7 @@ |
| 23 | + ;; |
| 24 | + usr) |
| 25 | + # users logged into the system |
| 26 | +- [ ${PATTERN:=".*"} ] |
| 27 | ++ PATTERN=${PATTERN:=".*"} |
| 28 | + if [ $(users | grep -cE "\b$PATTERN\b") -gt 0 ]; then |
| 29 | + REASON=${DESCRIPTION:-"active user"} |
| 30 | + break |
| 31 | +@@ -38,7 +38,7 @@ |
| 32 | + # - it uses language specific search patterns that will fail with localized versions of ping |
| 33 | + # - ping is slow if the specified host does not answer |
| 34 | + # |
| 35 | +- [ ${PATTERN:="."} ] |
| 36 | ++ PATTERN=${PATTERN:="."} |
| 37 | + TEMP=mktemp |
| 38 | + ping -c 1 -q $PATTERN >& $TEMP |
| 39 | + if [ $(grep -c "unknown host" $TEMP) -eq 0 ] && [ $(grep -e "transmitted.*received" $TEMP | cut -d "," -f 2 | cut -d " " -f 2) -gt 0 ]; then |
| 40 | +@@ -60,7 +60,7 @@ |
| 41 | + tcp) |
| 42 | + # network connections |
| 43 | + # test only the local ports of tcp connections |
| 44 | +- if [ $(netstat -t | grep -e "^tcp" | grep -ve "CLOSE_WAIT[ \t]*$" | sed -re "s/ +/ /g" | cut -d " " -f 4 | grep -cE ":$PATTERN\b") -gt 0 ]; then |
| 45 | ++ if [ $(ss -t -o state established | tail -n +2 | awk '{print $3}' | grep -cE ":$PATTERN\b") -gt 0 ]; then |
| 46 | + REASON=${DESCRIPTION:-"$PATTERN"} |
| 47 | + break |
| 48 | + fi |
| 49 | +diff -ruN vdr-addon-lifeguard-0.0.4/vdr-addon-lifeguard.1 vdr-addon-lifeguard-0.0.4.patched/vdr-addon-lifeguard.1 |
| 50 | +--- vdr-addon-lifeguard-0.0.4/vdr-addon-lifeguard.1 2010-10-02 02:38:45.000000000 +0200 |
| 51 | ++++ vdr-addon-lifeguard-0.0.4.patched/vdr-addon-lifeguard.1 2013-08-07 19:35:17.879538766 +0200 |
| 52 | +@@ -82,10 +82,9 @@ |
| 53 | + shutdown is cancelled. If no description is specified, the pattern or a predefind explanation will be used instead. |
| 54 | + |
| 55 | + .SH FILES |
| 56 | +-/etc/vdr/lifeguard.conf, /usr/share/vdr/S91.lifeguard |
| 57 | ++/etc/vdr/lifeguard.conf, /usr/share/vdr/shutdown-hooks/S91.lifeguard |
| 58 | + .SH SEE ALSO |
| 59 | +-.BR vdr (1), |
| 60 | +-.BR /usr/share/doc/vdr/README.Debian |
| 61 | ++.BR vdr (1) |
| 62 | + .br |
| 63 | + .SH AUTHOR |
| 64 | + vdr-addon-lifeguard and this manpage were written by Malte Forkel < [email protected]>, for the Debian project (but may be used by others). |
0 commit comments