tazpanel diff hosts.cgi @ rev 638
boot.iso: allow /dev/cdrom
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Jan 05 15:14:01 2022 +0000 (2022-01-05) |
parents | bf8941ab3cc3 |
children |
line diff
1.1 --- a/hosts.cgi Tue Feb 26 08:30:05 2019 +0100 1.2 +++ b/hosts.cgi Wed Jan 05 15:14:01 2022 +0000 1.3 @@ -158,7 +158,7 @@ 1.4 # Show diff 1.5 if [ -s "$HOSTSDIR/diff" ]; then 1.6 echo '<section><pre class="scroll">' 1.7 - cat "$HOSTSDIR/diff" | syntax_highlighter diff 1.8 + syntax_highlighter diff < "$HOSTSDIR/diff" 1.9 echo '</pre></section>' 1.10 fi 1.11 1.12 @@ -264,7 +264,7 @@ 1.13 <td> 1.14 EOT 1.15 1.16 - if [ -e "$HOSTSDIR/$letter" -o -n "$(grep -m1 "#$letter\$" /etc/hosts)" ]; then 1.17 + if [ -e "$HOSTSDIR/$letter" ] || grep -qm1 "#$letter\$" /etc/hosts; then 1.18 # List installed 1.19 1.20 # If /var/run/tazpkg/hosts/ was mistakenly cleaned 1.21 @@ -287,8 +287,7 @@ 1.22 1.23 if [ "$check" = 'yes' ]; then 1.24 # Check for update (not really download) 1.25 - busybox wget -s --header "If-Modified-Since: $(date -Rur "$HOSTSDIR/$letter")" "$url" 1.26 - if [ "$?" -eq 0 ]; then 1.27 + if busybox wget -s --header "If-Modified-Since: $(date -Rur "$HOSTSDIR/$letter")" "$url"; then 1.28 # Update available 1.29 touch "$HOSTSDIR/$letter.avail" 1.30 else