/usr/share/lftp/import-netscape is in lftp 4.3.3-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | #!/bin/sh
# This script is based on draft by Sam Steingold
# Copyright (c) 1998 by Alexander V. Lukyanov
# This script can be distributed and modified freely under GNU GPL, see COPYING
set -e
NS="$HOME/.netscape/bookmarks.html"
OLD="${LFTP_HOME:-$HOME/.lftp}/bookmarks"
NEW="$OLD.new.$$"
prepend_hash()
{
n=$$
while read line; do
u=`echo $line | sed -e 's|\(ftp://[^:]*\):[^@]*@|\1|'`
t=`expr "$u" : "ftp://\([^.]*\)"`
if [ "$t" = ftp -o -z "$t" ]; then
t=`expr "$u" : "ftp://[^.]*.\([^.]*\)"`
if [ "$t" = ftp -o -z "$t" ]; then
t="$n"
n=`expr $n + 1`
fi
fi
echo "NS-$t $line"
done
}
grep ftp:// "$NS" | cut "-d\"" -f2 | prepend_hash > "$NEW"
if [ -f "$OLD" ]; then
sort -u "$OLD" "$NEW" -o "$NEW"
mv -f "$OLD" "$OLD~" # backup
else
sort -u "$NEW" -o "$NEW"
fi
mv -f "$NEW" "$OLD"
|