Skip to content
This repository was archived by the owner on Sep 15, 2022. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ var hostname = [
{
type: "input",
name: "hostAddr",
message: "host IP address (with http:// || https://): ",
message: "host IP or DNS address (with http:// || https://): ",
validate: value => {
// validation for IP address.
let reg = /^(http|https):\/\/((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
// let reg = /^(http|https):\/\/((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
if (!value) return "host IP address required";
if (!value.match(reg)) return "please enter a valid IP address";
// if (!value.match(reg)) return "please enter a valid IP address";
return true;
}
}
Expand Down