Advertisement
s243a

/et c/rc.c/rc.network_basic

Apr 27th, 2015
440
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.03 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. #echo "Setting up interface lo..."
  4. ifconfig lo 127.0.0.1
  5. route add -net 127.0.0.0 netmask 255.0.0.0 lo
  6.  
  7. #begin rerwin
  8. if [ -f /root/.dhcpcd.duid ];then  #Using a DUID in client ID
  9.  #If running from pup_save file and no common DHCP Unique Identifier (DUID) present and partition has a full-install or partition-save and a duid file, make that file the common duid.
  10.  [ ! -s /mnt/home/.common.duid -a ! "`ls -l /mnt/home | cut -f 11 -d ' '`" = "/" -a -s /mnt/home/root/.dhcpcd.duid ] && cp /mnt/home/root/.dhcpcd.duid /mnt/home/.common.duid
  11.  #Ensure that any local duid matches the common duid or will force new duid.
  12.  [ -s /mnt/home/.common.duid ] && cp /mnt/home/.common.duid /root/.dhcpcd.duid || cp /dev/null /root/.dhcpcd.duid
  13.  if [ -s /root/.dhcpcd.duid ];then   #duid info for DHCP request.
  14.   [ ! -d /var/lib/dhcpcd ] && mkdir /var/lib/dhcpcd
  15.   cp /root/.dhcpcd.duid /var/lib/dhcpcd/dhcpcd.duid
  16.  else  #Force new DUID
  17.   [ -f /var/lib/dhcpcd/dhcpcd.duid ] && rm /var/lib/dhcpcd/dhcpcd.duid
  18.  fi
  19. fi
  20. #end rerwin
  21.  
  22.  
  23. ###END###
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement