Created
July 24, 2023 13:21
-
-
Save benfavre/dfc21dbbdfc43862635c8642e9602985 to your computer and use it in GitHub Desktop.
FIND OVH FTP HOST for given login, password
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ftp = require("basic-ftp") | |
let currentServer = 1; | |
const getHost = (number) => { | |
number = number.toString().padStart(3, '0'); | |
let host = `ftp.cluster${number}.hosting.ovh.net`; | |
console.log('Host is :', host); | |
return host; | |
} | |
const connectFtp = async (number) => { | |
let client = new ftp.Client() | |
client.ftp.verbose = true | |
try { | |
await client.access({ | |
host: getHost(number), | |
user: "YYYYYYYY", | |
password: "XXXXXX", | |
secure: false | |
}) | |
} | |
catch(err) { | |
console.log(err) | |
currentServer++; | |
connectFtp(currentServer); | |
} | |
} | |
connectFtp(currentServer); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment