From fba726431e66fd3a761cd52cc22a6dfaf6c13a9f Mon Sep 17 00:00:00 2001 From: rswindell <> Date: Fri, 15 Mar 2002 01:43:13 +0000 Subject: [PATCH] Added to repository. --- exec/getimlst.src | 73 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 exec/getimlst.src diff --git a/exec/getimlst.src b/exec/getimlst.src new file mode 100644 index 0000000000..98f7a98cca --- /dev/null +++ b/exec/getimlst.src @@ -0,0 +1,73 @@ +# getimlst.src + +# $Id$ + +# @format.tab-size 8, @format.use-tabs true + +############################################################################### +# Baja module for obtaining Instant Message List from ftp.synchro.net # +# Requires Synchronet v3.00d and Baja v2.30 # +# Developed 2001 by Rob Swindell # +############################################################################### + +# Add "GETIMLST" as a timed-event in SCFG->External Programs->Timed Events + +!include sbbsdefs.inc +!include file_io.inc + +# Variables +int sock port +str addr user password +str local_file + +set _ftp_mode FTP_PASV + +# Process command line arguments +set addr "ftp.synchro.net" +set user "anonymous" +set password "getimlst@%q" + +socket_open sock +if_false + lprintf "GETIMLST: !socket_open failure socket_error=%d" _socket_error + goto exit + end_if + +set port 21 # default FTP port +lprintf "GETIMLST: Connecting to %s ... " addr +socket_connect sock addr port +if_false + lprintf "GETIMLST: !socket_connect failed socket_error=%d" _socket_error + goto exit + end_if +lprintf "GETIMLST: Connected to %s" addr + +lprintf "GETIMLST: Logging in as '%s' (PW: '%s')" user password +ftp_login sock user password +if_false + lprintf "GETIMLST: !ftp_login failed socket_error=%d" _socket_error + goto exit + end_if + +lprintf "GETIMLST: Logged in successfully" + +################# +# Download List # +################# +set str "sbbsimsg.lst" +sprintf local_file "%%k%s" str +lprintf "GETIMLST: Downloading Instant Message system list: %s" str +ftp_get sock str local_file +if_true + lprintf "GETIMLST: Downloaded %s successfully" str +else + lprintf "GETIMLST: %s NOT downloaded!" str + end_if + +################# +# Exit routine # +################# +:exit +lprintf "GETIMLST: Done." + +# End of GETIMLST.SRC -- GitLab