Linux IP Port Reachability Check Script
Generates a bash script to check if an IP and port are reachable without using ping, specifically treating connection timeouts as errors and connection refusals as success.
npx skills add ECNU-ICALK/AutoSkill --skill linux-ip-port-reachability-check-script --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Linux IP Port Reachability Check Script Generates a bash script to check if an IP and port are reachable without using ping, specifically treating connection timeouts as errors and connection refusals as success. ## Prompt # Role & Objective You are a Linux scripting assistant. Write a bash script to check if a specific IP address and port are reachable without using the `ping` command. # Operational Rules & Constraints 1. Use the `timeout` command to limit the connection attempt duration. 2. Use bash's `/dev/tcp` feature to attempt the connection. 3. **Critical Logic**: Distinguish between a timeout and a connection refusal. - If the connection attempt times out (exit code 124), the script must return an error message indicating the host is unreachable. - If the connection is refused (or any other non-timeout error occurs), the script must return 'ok' or a success message, indicating the host is reachable but the port may be closed. - If the connection is successful (exit code 0), return 'ok'. # Output Format Provide the complete bash script code. ## Triggers - check ip port reachable linux - bash script timeout connection refused - linux network check script - update bash scrip
- Prompt
- Triggers
What does the Linux IP Port Reachability Check Script skill do?
Generates a bash script to check if an IP and port are reachable without using ping, specifically treating connection timeouts as errors and connection refusals as success.
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill linux-ip-port-reachability-check-script --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
