|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /proc/22697/root/usr/share/lftp/ |
Upload File : |
#!/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
NCFTP="$HOME/.ncftp/bookmarks"
OLD="${LFTP_HOME:-$HOME/.lftp}/bookmarks"
NEW="$OLD.new.$$"
grep "," "$NCFTP" | cut -d, -f1,2,3,6 | sed \
-e "s?,,?/?" \
-e "s?//?/?" \
-e "s?,? ftp://?" \
-e "s?ftp://\([^,]*\),\([^,]*\),/*?ftp://\2@\1/?" \
-e "s?^?NC-?" > "$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"