Alpha
Share and Organize Code
login register
HotNewTop
F.A.Q.
1. To begin adding code first register.
2. Create your own tags for code that you add.
3. To see your own code click Me, to see all code click Everyone, or filter by people rob.
4. To follow a user, click on their username, rob and hit follow.
5. Add other code to your library by clicking the
button near the code titles (note that you can not edit these codes).
6. To create a copy of a code that you can edit use fork.
7. If you can't find your code, double check your filter settings as you can filter by Category, User and Tag simultaneously.
8. Add comments to a code by clicking on it's title or the comments link underneath it.

Network Test (plain)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash
# --- Script: /usr/local/sbin/commtest
# --- Permissions: Ensure you execute 'chmod 0700 commtest'
# --- Author: Paul Greene
# --- Objective: Verify ports are open to or on your server for applications to run
# --- Notes: This will simply output PASS or FAILED. Ensure nmap is installed.

# --- Verify Network communication is open to your MySQL Database
echo ""
echo "TEST 1 - Verify Network communication is open to DB"
portchk=`nmap -v -p 3306 localhost | awk '{print $2}' | awk 'NR==6'`
if [ "$portchk" = "open" ]; then
        echo "MySQL port 3306 is open to web server ...PASSED"
else
        echo "MySQL port 3306 is closed to web server ...FAILED"
fi
[+] (12) more...
comments (1) flag fork
If you save this script in /usr/local/sbin ... you can type 'commtest' as root user anywhere and it will run like any other command - prdgreene 5 Years ago