renamed to reflect version it is for

This commit is contained in:
TomasM
2019-10-19 19:01:58 +00:00
parent 5f0ccd3362
commit 7bca13b9a6
224 changed files with 0 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
#!/bin/bash
LOCK=/run/lock/gtk-bookmark-update-lock
BOOKMARKS=/root/.gtk-bookmarks
# make sure to avoid parallel execution by using mkdir as lock
while true; do
mkdir $LOCK 2>/dev/null
if [ $? = 0 ]; then
break
fi
done
cat $BOOKMARKS | fgrep -v ///media/ | fgrep -v "file:/// /" | egrep -v '^$' > $BOOKMARKS.tmp 2>/dev/null
ls -1 /media | sort | while read LINE; do
echo "file:///media/$LINE $LINE" >> $BOOKMARKS.tmp
done
echo "file:/// /" >> $BOOKMARKS.tmp # add root at the beginning
mv -f $BOOKMARKS.tmp $BOOKMARKS
rmdir $LOCK