diff options
-rwxr-xr-x | blogsend | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -8,15 +8,15 @@ # folders rf=mail:/var/www/html/wittamore.com mf=~/.local/src/web/wittamore.com -cd $mf +cd $mf || exit # test if var is sent -if [[ -z "$1" ]]; then +if [ -z "$1" ]; then HOURS=1; else # test if va is a number - if [[ "$1" =~ ^[0-9]+$ ]]; then - HOURS=$1; + if [ "$1" -eq "$1" ]; then + HOURS="$1"; else HOURS=1; fi @@ -26,10 +26,9 @@ MINUTES=$(($HOURS*60)) echo "Sending files modified in the past $HOURS hour(s)..." -files=$(find * -iname "*.html" -path .tmp -prune -o -mmin -$MINUTES -type f) +files=$(find -- * -iname *.html -path .tmp -prune -o -mmin -$MINUTES -type f) for file in $files do - echo -ne "-> "; scp -r "$file" "$rf/$file"; done |