aboutsummaryrefslogtreecommitdiff
path: root/blogsend
diff options
context:
space:
mode:
authorPhilip Wittamore <philip@wittamore.com>2025-05-08 21:51:14 +0200
committerPhilip Wittamore <philip@wittamore.com>2025-05-08 21:51:14 +0200
commita8d4f76ffeb6a39d6503eeb5594ece773a7d0512 (patch)
treec66c4fdeef193b4b3b12a2246ceb2cc748321d3b /blogsend
parent4f8a7f353c08690ece6da786bb340ba67e194271 (diff)
downloadblog-a8d4f76ffeb6a39d6503eeb5594ece773a7d0512.tar.gz
blog-a8d4f76ffeb6a39d6503eeb5594ece773a7d0512.tar.bz2
blog-a8d4f76ffeb6a39d6503eeb5594ece773a7d0512.zip
update
Diffstat (limited to 'blogsend')
-rwxr-xr-xblogsend11
1 files changed, 5 insertions, 6 deletions
diff --git a/blogsend b/blogsend
index 6aaa041..572e60f 100755
--- a/blogsend
+++ b/blogsend
@@ -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