Skip to content

Commit 56afc29

Browse files
Now using 'name.chat_id' for the folders to prevent clashing folder names for entries in different chats
1 parent f847757 commit 56afc29

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

urlwatcher/urlwatcher.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,16 @@ while IFS='' read -r line || [ -n "${line}" ]; do
170170
URL=$(echo $line | cut -d ',' -f9-)
171171

172172
echo "Checking $URL"
173+
174+
# As image directory, we use the name and chat id to create unique directories
173175

174176
# Create the image directory, if it does not exist yet
175-
if [ ! -d "$IMAGES_DIRECTORY/$NAME" ]; then
176-
mkdir "$IMAGES_DIRECTORY/$NAME"
177+
if [ ! -d "$IMAGES_DIRECTORY/${NAME}.${CHAT_ID}" ]; then
178+
mkdir "$IMAGES_DIRECTORY/${NAME}.${CHAT_ID}"
177179
fi
178180

179181
# Go into it
180-
cd "images/$NAME"
182+
cd "images/${NAME}.${CHAT_ID}"
181183

182184
# Rename the old screenshot file, if it exists
183185
if [ -f latest.png ]; then

0 commit comments

Comments
 (0)