Setting external IP on Pure-FTPd
Cannot FTP back to your DNS-323? Directory listing fail on the Pure-FTPd? Need to do passive (pasv) ftp on the Pure-FTPd on the DNS-323/DNS-343?
I face some problems while trying to ftp to my DNS-323/DNS-343 behind the router. Sometimes it works and sometimes it doesn’t. I normally have problem when I am trying to ftp from a location that is behind NAT as well.
Wrote up a shell script for starting the Pure-FTPd correctly on DNS-323 and DNS-343. It is meant for fonz’s fun_plug 0.5 and firmware on the DNS-323 should be greater than 1.04. Just edit the necessary settings and Pure-FTPd will start as a chroot daemon.
The shell script will detect you WAN IP and pass in as a parameter to start the daemon.
Download the file: pure-ftpd.sh
Content of the file
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 39 40 41 42 43 44 45 46 | #!/ffp/bin/sh # PROVIDE: Pure-FTPD . /ffp/etc/ffp.subr # shadowandy.sg[at]gmail.com # ftp port to listen on pureftp_ftpport="20021" # passive port range to use pureftp_passive="20032:20039" # bandwidth limit down:up in kB pureftp_bandwidth="380:8" ##### You should not need to edit anything below ##### name="pure-ftpd" start_cmd="pureftpd_start" stop_cmd="pureftpd_stop" status_cmd="pureftpd_status" pureftpd_start() { tmp_ip="/ffp/tmp/pureftp_ip.tmp" ip_tmp=`wget http://checkip.dyndns.com:8245/ -q -O /ffp/tmp/pureftp_ip1.tmp` ip_add=`cat /ffp/tmp/pureftp_ip1.tmp | grep "IP Address" | sed -e 's/</ /g' | awk '{ print $11 }'` ip_command="echo $ip_add" echo "Starting $name" pure-ftpd -P ${ip_add} -p ${pureftp_passive} -S ,${pureftp_ftpport} -A -B -C 10 -I 2 -E -T ${pureftp_bandwidth} } pureftpd_stop() { echo "Stopping $name" killall $name } pureftpd_status() { _pids=$(pidof $name) if test -n "$_pids"; then echo "$name is running" else echo "$name not running" fi } run_rc_command "$1" |