/[fai]/trunk/bin/fai-setup
ViewVC logotype

Diff of /trunk/bin/fai-setup

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 5428 by lange, Thu Apr 9 13:27:13 2009 UTC revision 5429 by lange, Sat Jul 18 16:29:12 2009 UTC
# Line 115  setup_fai_account() { Line 115  setup_fai_account() {
115              [ -f /etc/ssh/ssh_host_dsa_key.pub ] && DSASERVER=$(sed -e "s/= .*$/=/" /etc/ssh/ssh_host_dsa_key.pub)              [ -f /etc/ssh/ssh_host_dsa_key.pub ] && DSASERVER=$(sed -e "s/= .*$/=/" /etc/ssh/ssh_host_dsa_key.pub)
116              [ -f /etc/ssh/ssh_host_rsa_key.pub ] && RSASERVER=$(sed -e "s/= .*$/=/" /etc/ssh/ssh_host_rsa_key.pub )              [ -f /etc/ssh/ssh_host_rsa_key.pub ] && RSASERVER=$(sed -e "s/= .*$/=/" /etc/ssh/ssh_host_rsa_key.pub )
117              # determine all IP addresses, and their host names              # determine all IP addresses, and their host names
118              ips=$(LC_ALL=C ifconfig| perl -ne '/addr:([\d.]+)/ && print"$1\n"'|grep -v 127.0.0.1)              ips=$(ip addr | grep -w inet | cut -d t -f 2 | cut -d ' ' -f 2 | grep -v 127.0.0.1)
119              for ip in $ips; do              for ip in $ips; do
120                  hname=$(getent hosts $ip| tr -s ' ' ',')                  hname=$(getent hosts $ip| tr -s ' ' ',')
121                  [ -z "$hname" ] && hname=$ip                  [ -z "$hname" ] && hname=$ip
# Line 176  if [ -z "$expert" ]; then Line 176  if [ -z "$expert" ]; then
176      test -f /etc/init.d/nfs-kernel-server && nfsserver=nfs-kernel-server      test -f /etc/init.d/nfs-kernel-server && nfsserver=nfs-kernel-server
177      test -f /etc/init.d/nfs-user-server && nfsserver=nfs-user-server      test -f /etc/init.d/nfs-user-server && nfsserver=nfs-user-server
178    
179      addr=$(LC_ALL=C ifconfig $SERVERINTERFACE | grep -v 127.0.0.1 | perl -ne '/addr:([\d.]+)/ && print"$1\n"'|head -1)      addr=$(ip addr show dev $SERVERINTERFACE | grep -w inet | cut -d t -f 2 | cut -d ' ' -f 2 | cut -d / -f 1 | grep -v 127.0.0.1 | head -1)
     mask=$(LC_ALL=C ifconfig $SERVERINTERFACE | grep -v 127.0.0.1 | perl -ne '/Mask:([\d.]+)/ && print"$1\n"'|head -1)  
180    
181      if expr match "$FAI_CONFIG_SRC" 'nfs:\/\/' > /dev/null; then      if expr match "$FAI_CONFIG_SRC" 'nfs:\/\/' > /dev/null; then
182          add_export_line $FAI_CONFIGDIR  "$addr/$mask(async,ro,no_subtree_check)"          add_export_line $FAI_CONFIGDIR  "$addr(async,ro,no_subtree_check)"
183      fi      fi
184      add_export_line $NFSROOT  "$addr/$mask(async,ro,no_subtree_check,no_root_squash)"      add_export_line $NFSROOT  "$addr(async,ro,no_subtree_check,no_root_squash)"
185      if [ -z "$nfsserver" ]; then      if [ -z "$nfsserver" ]; then
186          echo "Could not find the type of your nfs server. Maybe"          echo "Could not find the type of your nfs server. Maybe"
187          echo "no nfs server is installed. I can't restart it."          echo "no nfs server is installed. I can't restart it."

Legend:
Removed from v.5428  
changed lines
  Added in v.5429

  ViewVC Help
Powered by ViewVC 1.1.5