// Throw if OS is not Linux or BSD. This should be changed to throw if not Debian based distro. Eventually, we can add more exceptions as `up` handles more cases.
@ -10,15 +12,15 @@ function validate(domain, inPort, outPort) {
outPort=outPort||80;
// Error messages
vardomainInvalidMsg=["\nPlease use a domain name instead of an IP address.","\nDomain is not valid. Please use a valid domain name."];
varportInvalidMsg=["\nPort should be a number.","\nPort should be a number from 1 and 65535."];
constdomainInvalidMsg=["\nPlease use a domain name instead of an IP address.","\nDomain is not valid. Please use a valid domain name."];
constportInvalidMsg=["\nPort should be a number.","\nPort should be a number from 1 and 65535."];
// ARGV returns a string as input. Port numbers should be parsed to int to validate them. If validation fails, these will return undefined and will fail the subsequent test.
varvalidInPort=parseToInt(inPort);
varvalidOutPort=parseToInt(outPort);
constvalidInPort=parseToInt(inPort);
constvalidOutPort=parseToInt(outPort);
// The value of isInvalid will be returned back. If none of the `if`s are true, the default value `true` is returned `domain`, `inPort` and `outPort` are considered validated.