Simon icon Simon
Flexible server monitoring

FTP Directory Listing - Password starts with "$"

Dear Forum,

i want to check changes on an ftp-server with your application. Everything works fine with 2 other servers. But the password on the third ftp-server i want to check starts with an "$". Simon says "Undefined variable. (1)" because it thinks that "$" is the start of a command or so. Have you any idea besides changing the password?

I am not able to change the pw because the server is run by a very large customer of us ...

David Sinclair's picture

Re: FTP Directory Listing - Password starts with "$"

Try prefixing the $ with a \ (i.e. \$) — that should "escape" it.

Re: FTP Directory Listing - Password starts with "$"

Thank you! Works fantastic!

Re: FTP Directory Listing - Password starts with "$"

Mhhhm - now i get an error from the ftp-server that says: "Unknown command EPSV".

Any idea how to fix that? I found no option the change the mode?!

It's just at that server. The other one is not giving an error?!

David Sinclair's picture

Re: FTP Directory Listing - Password starts with "$"

It appears that "EPSV" is a command to use IPv6 addressing... so adding the -4 option to the ftp command (as part of the service script) might prevent this error.

Re: FTP Directory Listing - Password starts with "$"

Adding the -4 option hast no effect. The mistake is still the same.

Here is my syntax:

ftp -n -4 {Domain} << EOF
user {Username} {Password}
cd {Directory Path}
ls
EOF

Is that correct?

The message is still "Unknown command EPSV"

Any ideas?

David Sinclair's picture

Re: FTP Directory Listing - Password starts with "$"

Well, it was worth a try. :) Does anyone else have any ideas?

But does this message actually matter? I have sometimes seen similar messages with FTP apps, but it is just informational — it doesn't cause an error.

Re: FTP Directory Listing - Password starts with "$"

Yes, this message matters because simon is not able navigate to the subdirectory it shall have an eye on and gives me an error (red triangle) :( .

David Sinclair's picture

Re: FTP Directory Listing - Password starts with "$"

Next suggestion: try doing the commands from the script in Terminal (one at a time). You may be able to figure out a way around the error. Surely the server must support FTP connection, so anything you can do in Terminal you should be able to replicate in Simon's service script.

Re: FTP Directory Listing - Password starts with "$"

That's funny. When i do the commands in Terminal everything is ok. The directory is listed the right way.

Here is the code from the terminal:

Connected to XXXXXXXXXXXX.com.
220 x.local X2 WS_FTP Server 7.5.1(00000000)
331 Enter password
230 User logged in
Remote system type is UNIX.
250 Command CWD succeed
500 Unknown command EPSV
227 Entering Passive Mode (225,19,345,0,156,83).
150 Transferring directory
dr-x------ 2 XXX System 0 Jun 14 10:59 .
dr-x------ 2 XXX System 0 Jun 14 07:30 ..
-r-x------ 1 XXX System 920716 Mar 06 2008 alteppe.jpg
-r-x------ 1 XXX System 24200 Jun 14 10:58 erz4.docx
-r-x------ 1 XXX System 424655 Mar 18 2010 m66_M.jpg
-r-x------ 1 XXX System 3788531 Nov 05 2011 mXXL.jpg
-r-x------ 1 XXX System 806559 Mar 07 2012 so_M.jpg
226 Transfer completed
221 bye

-> and Simon stopps at

Unknown command EPSV
dr-x------ 2 XXX System 0 Jun 14 10:59 .
dr-x------ 2 XXX System 0 Jun 14 07:30 ..

and then gets a timeout ...

David Sinclair's picture

Re: FTP Directory Listing - Password starts with "$"

Weird. Passive mode does seem to be the issue with this server.

Looking at man ftp in Terminal, another option that might help is -A, which forces active mode. That should suppress the EPSV command, I'd think, so might help.

Beyond that, I'm out of ideas.

Re: FTP Directory Listing - Password starts with "$"

Thanks for your help. I'll try this on monday at the office. Have a super-nice weekend. And thanx for your support again.

Re: FTP Directory Listing - Password starts with "$"

Hi!

I tried the -A command but it didn't work. Seems that i have to check this ftp-server manually ... Thanx for your help anyway.