aggressivenetworks
New Member
I was wondering what is a good source for how to learn shell scripting? I really want to become proficient in it. Here is example of my work i wrote to get the ipv4 side of the network running correctly in fedora 21 beta openvz template. If there is anything you can point out i would greatly appreciate it.
#!/bin/bash
# grabbing ip from ifcfg
for address in $(cat /etc/sysconfig/network-scripts/ifcfg-venet0:0 | grep -o 'IPADDR=[^\n]*' | cut -f2- -d'=')
do
/sbin/ip addr add $address/30 broadcast $address dev venet0:0
done
#!/bin/bash
# grabbing ip from ifcfg
for address in $(cat /etc/sysconfig/network-scripts/ifcfg-venet0:0 | grep -o 'IPADDR=[^\n]*' | cut -f2- -d'=')
do
/sbin/ip addr add $address/30 broadcast $address dev venet0:0
done