-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetimlst.src
73 lines (58 loc) · 1.78 KB
/
getimlst.src
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# getimlst.src
# $Id: getimlst.src,v 1.1 2002/03/15 01:43:13 rswindell Exp $
# @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