annna-add-hashtag: improve sharing across all worker classes - annna - Annna th… | |
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
--- | |
commit 139fc2bdda823b5693b07bfedaecbd678e26fd14 | |
parent 129e2f5f32ab6d235402a28c5c2c2fccbb5b59f9 | |
Author: Annna Robert-Houdin <[email protected]> | |
Date: Sat, 8 Feb 2020 19:07:44 +0100 | |
annna-add-hashtag: improve sharing across all worker classes | |
Keep permissions 664 for :bitreich group and use an absolute path. | |
This allows to call the script via SSH as a bitreich user. | |
Diffstat: | |
M annna-add-hashtag | 6 ++++-- | |
1 file changed, 4 insertions(+), 2 deletions(-) | |
--- | |
diff --git a/annna-add-hashtag b/annna-add-hashtag | |
@@ -2,7 +2,7 @@ | |
memecachedir="/br/gopher/memecache" | |
hashtagdb="/home/annna/bin/modules/hashtags/hashtags.txt" | |
-unprocessed="$(pwd)/unprocessed.txt" | |
+unprocessed="/home/annna/bin/modules/hashtags/unprocessed.txt" | |
[ ! -e "${hashtagdb}" ] && touch "${hashtagdb}" | |
@@ -89,6 +89,9 @@ inserttag() { | |
printf "tag '%s' added as '%s' to hashtags db.\n" "${tag}" "${memecach… | |
sort "${hashtagdb}" > "${hashtagdb}.sort" | |
mv "$hashtagdb.sort" "${hashtagdb}" | |
+ # keep permissions shared. | |
+ chown ':bitreich' "${hashtagdb}" | |
+ chmod 664 "${hashtagdb}" | |
} | |
addtag() { | |
@@ -121,4 +124,3 @@ else | |
done | |
fi | |
fi | |
- |