Skip to content

Instantly share code, notes, and snippets.

@benfavre
Created July 24, 2023 13:21
Show Gist options
  • Save benfavre/dfc21dbbdfc43862635c8642e9602985 to your computer and use it in GitHub Desktop.
Save benfavre/dfc21dbbdfc43862635c8642e9602985 to your computer and use it in GitHub Desktop.
FIND OVH FTP HOST for given login, password
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