Size: 256
Comment:
|
Size: 1238
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
= bash = | |
Line 4: | Line 5: |
{{{ | {{{#!highlight bash |
Line 13: | Line 14: |
== Add extra IP address to NIC == Adapted from http://unclean.org/howto/secondip.html Add extra IP 192.168.1.5 to NIC eth0 {{{#!highlight bash ifconfig eth0:0 192.168.1.5 route add -host 192.168.1.5 dev eth0:0 }}} == Check port running == {{{#!highlight bash #!/bin/sh RES=`netstat -at -n | grep 0.0.0.0:12345 | wc -l` if [ $RES -eq '1' ] then logger 'Process running' else logger 'Process not listening on port 12345' /sbin/service processx restart logger 'Process restarted' fi }}} {{{#!highlight bash #!/bin/sh RES=`netstat -at -n | grep 0.0.0.0:12345 | wc -l` if [ $RES -ne '1' ] then logger 'Process not listening on port 12345' /sbin/service processx restart logger 'Process restarted' fi }}} == ColorBash prompt == https://wiki.archlinux.org/index.php/Color_Bash_Prompt * start coloring: \[\e[color\] * end coloring: \[\e[m\] * \e[0;32m\] #green color * \e[0;33m\] #yellow color |
bash
Bourne again shell.
Server loop
Add extra IP address to NIC
Adapted from http://unclean.org/howto/secondip.html
Add extra IP 192.168.1.5 to NIC eth0
Check port running
ColorBash prompt
https://wiki.archlinux.org/index.php/Color_Bash_Prompt
- start coloring: \[\e[color\]
- end coloring: \[\e[m\]
- \e[0;32m\] #green color
- \e[0;33m\] #yellow color