Advertisement
keppler

Hostname

Jul 9th, 2011
132
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. printf "ambiente%02d-%03d" $(ifconfig | sed -n '2s/^[^:]*: [0-9]*\.[0-9]*\.\([0-9]*\)\.\([[0-9]*\).*/\1 \2/;2p')
  2.  
  3.  
  4. #Linha adicionada na seção %post do kickstart
  5.  
  6. sed -i "/^HOSTNAME=/ s/=.*$/=$(printf "sala%02d-%03d.teste.com" $(ifconfig | sed -n '2s/^[^:]*: [0-9]*\.[0-9]*\.\([0-9]*\)\.\([[0-9]*\).*/\1 \2/;2p'))/" /etc/sysconfig/network
Advertisement
RAW Paste Data Copied
Advertisement