summaryrefslogtreecommitdiff
path: root/pull_thoughts
diff options
context:
space:
mode:
authorgrothedev <grothedev@gmail.com>2021-08-09 02:42:44 -0500
committergrothedev <grothedev@gmail.com>2021-08-09 02:42:44 -0500
commit98250e3e97bdee6432385750fcf4aef8f1a61d55 (patch)
treef128650013b8cb54f49e8f1be66987fb5485e381 /pull_thoughts
parentc7699709f14315793a300d1db76bc0c4804eeae0 (diff)
added multiple file update to word appending thing
Diffstat (limited to 'pull_thoughts')
-rwxr-xr-xpull_thoughts8
1 files changed, 6 insertions, 2 deletions
diff --git a/pull_thoughts b/pull_thoughts
index 386506a..4375aee 100755
--- a/pull_thoughts
+++ b/pull_thoughts
@@ -1,19 +1,23 @@
#
-exit 1
#TODO update
t="/srv/www/thesite/public/t/*"
+if [[ -z ~/t.remote/ ]]; then mkdir ~/t.remote; fi
+echo "remote text files:"
+ssh hb "ls ${t}"
scp -r hb:$t ~/t.remote/
for f in `ls ~/t.remote/`; do
+ echo "checking "${f}
if [ -e ~/${f} ]; then
fog=~/${f}
elif [ -e ~/doc/${f} ]; then
fog=~/doc/${f}
fi
+ echo "backing up "${fog}
cp ${fog} ${fog}.prev
cat ~/t.remote/${f} > ${fog}
echo "" >> ${fog}
cat ${fog}.prev >> ${fog}
rm ~/t.remote/${f}
- rm ${f}.prev
+ rm ${fog}".prev"
ssh hb "echo '' >> ${f}.bak; cat ${fog} >> ${f}.bak; rm ${f}; touch ${f}; chmod a+w ${f}; sudo chown www-data:www-data ${f}"
done