Skip to content

Commit 8085c81

Browse files
committed
Adding the getip.sh scripts.
1 parent d602673 commit 8085c81

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

README.markdown

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,6 @@ This script grabs charts made is google spreadsheets and builds a background fro
1818

1919
## linux_audit.sh
2020
This is a little script I tossed together to audit a series of virtual LAMP servers I was building for a client, allowing me to easily compare their requirements with my results when I was done and report those results to them for their own purposes. Things like the number of processors, hard drive space, RAM, certain software versions can be quickly seen in the output. I ran it with this little one-liner './linux_audit.sh > `hostname`.audit.txt'. One advantage of this is that errors from running commands where the software doesn't exist simply resulted in no output in the reported document rather than showing a error so it was a bit cleaner.
21+
22+
## getip.sh & getipv6.sh
23+
Simple scripts that returns the IP or IPv6 address of a linux box and nothing but. This can be pretty handy since Linux doesn't provide this info on its own without adding lots of other info.

getip.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
# shared by Jay Rishel @jrishel rishel.org
3+
4+
IFCONFIG_PATH=/sbin
5+
6+
$IFCONFIG_PATH/ifconfig $1 |grep -E "addr:[0-9]" |awk '{print $2}' |colrm 1 5

getipv6.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
# based on Jay Rishel's getip script (@jrishel rishel.org)
3+
4+
IFCONFIG_PATH=/sbin
5+
6+
$IFCONFIG_PATH/ifconfig $1 |grep -E "inet6 addr" |awk '{print $3}'

0 commit comments

Comments
 (0)