Zeta:
Debugging scripts like that is less than trivial, mainly because it depends on external binaries on the hosting system; /bin/ping and /bin/ftp.
The current use of ping is especially questionable, as most implementations would block your eggdrop for considerably amounts of time. This is also what currently fails in your script. The actual error message(s) and/or return values are discarded however, leaving no clues as to whether the binary (/bin/ping) is actually there and executable, or whether (and why) the ping binary returns an error condition.
The interaction with the ftp binary is poor at best, not checking the response of any issued commands. This would probably be the main reason for the initial ping in the first place.
Also, this script has a poor time-mask, causing it to trigger once every minute 12:00am through 12:59am.