Opened 12 years ago

Closed 12 years ago

#61 closed enhancement (fixed)

Crear Hostname dinamico al bootear

Reported by: sebas Owned by:
Priority: major Milestone:
Component: servicio : dhcp / netboot Version:
Keywords: Cc:

Description

Para las maquinas que se enchufan por primera vez al red necesitamos crear un hostname de manera dinamica. Es necesario para la instalacion.

Change History (6)

comment:3 Changed 12 years ago by sebas

$ ifconfig | grep direcc | awk '{ print $5 }' | sed s/:/-/g

comment:4 Changed 12 years ago by sebas@…

http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2010q1/003811.html posteo en la lista de dnsmasq a ver que dicen ellos!

comment:5 Changed 12 years ago by sebas@…

primera version del script. :) hay que probarlo bien.

#!/bin/bash -x

if [ "$1" = "del" ]; then
  exit
fi

isnew_mac=$(cat /etc/ethers|grep -v "^#"|grep "$2")

generatedhostname=$(echo "$2"| tr -d ':')

if [ -z "$isnew_mac" ]; then
   echo $2 PC$generatedhostname >> /etc/ethers
   /etc/init.d/dnsmasq restart
#   kill -HUP 5236
#   kill -USR1 5236
fi

comment:6 Changed 12 years ago by sebas@…

Resolution: fixed
Status: newclosed

listo r555 r556 r557 r558 r559 r560

hay que probarlo ahora.

Note: See TracTickets for help on using tickets.