mirror of https://github.com/tLDP/LDP
Minor fixes and updates
This commit is contained in:
parent
d4efe0381c
commit
7b263f10c3
|
@ -42,9 +42,6 @@ done
|
||||||
|
|
||||||
shift $((OPTIND-1))
|
shift $((OPTIND-1))
|
||||||
|
|
||||||
# Renice script
|
|
||||||
renice -n 10 $$ >/dev/null
|
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
file_input="Linux+IPv6-HOWTO.sgml"
|
file_input="Linux+IPv6-HOWTO.sgml"
|
||||||
#file_input="Linux+IPv6-HOWTO.xml"
|
#file_input="Linux+IPv6-HOWTO.xml"
|
||||||
|
|
|
@ -1,12 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
|
||||||
# (P) & (C) 2011 - 2011 by Dr. Peter Bieringer <pb@bieringer.de>
|
|
||||||
#
|
|
||||||
# wrapper script for generate.sh
|
|
||||||
#
|
|
||||||
# 20110517/PB: initial release
|
|
||||||
# 20110518/PB: minor improvements
|
|
||||||
|
|
||||||
|
|
||||||
URL_BASE="http://cvs.tldp.org/go.to/LDP/LDP/users/Peter-Bieringer/"
|
URL_BASE="http://cvs.tldp.org/go.to/LDP/LDP/users/Peter-Bieringer/"
|
||||||
|
|
||||||
|
@ -18,7 +10,7 @@ FILE_PT_BR="Linux+IPv6-HOWTO.pt_BR.sgml"
|
||||||
options_wget="--quiet"
|
options_wget="--quiet"
|
||||||
DIR_DOWNLOAD="download"
|
DIR_DOWNLOAD="download"
|
||||||
|
|
||||||
DIR_DEST_BASE="/var/www/html/howto"
|
DIR_DEST_BASE="/var/www/html/howtos"
|
||||||
|
|
||||||
## logging
|
## logging
|
||||||
log() {
|
log() {
|
||||||
|
@ -53,8 +45,8 @@ download() {
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "force_download" != "1" ]; then
|
if [ "$force_download" != "1" ]; then
|
||||||
log "NOTICE" "skip download $url_base/$file (use option -f)"
|
log "NOTICE" "skip download $url_base/$file (use option -d)"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -102,6 +94,17 @@ check() {
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
|
if cmp -s "$file" "$DIR_DOWNLOAD/$file"; then
|
||||||
|
log "INFO" "'old' is identical with 'new' file: $file"
|
||||||
|
else
|
||||||
|
log "NOTICE" "'old' is not equal with 'new' file: $file"
|
||||||
|
cp -p "$DIR_DOWNLOAD/$file" "$file"
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
log "ERROR" "can't copy 'new' file to 'old' file: $DIR_DOWNLOAD/$file -> $file"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
# check contents of destination directory
|
# check contents of destination directory
|
||||||
log "INFO" "check directory: $dir"
|
log "INFO" "check directory: $dir"
|
||||||
|
|
||||||
|
@ -129,11 +132,6 @@ check() {
|
||||||
log "WARN" "'old' is newer than 'new' file: $file"
|
log "WARN" "'old' is newer than 'new' file: $file"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if cmp -s "$file" "$DIR_DOWNLOAD/$file"; then
|
|
||||||
log "INFO" "'old' is identical with 'new' file: $file"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# nothing to do
|
# nothing to do
|
||||||
|
|
Loading…
Reference in New Issue