source: trunk/puppet/modules/puppet-dnsmasq/files/dnsmasq-genhostname.sh @ 555

Last change on this file since 555 was 555, checked in by sebas@…, 14 years ago

script y archivo para generar los nombres de maquina desde la mac address

  • Property svn:executable set to *
File size: 298 bytes
RevLine 
[555]1#!/bin/bash
2
3if [ "$1" = "del" ]; then
4  exit
5fi
6
7isnew_mac=$(cat /etc/dnsmasq.hostsfile|grep -v "^#"|grep "$2")
8
9generatedhostname=$(echo "$2"| tr -d ':')
10
11if [ -z "$isnew_mac" ]; then
12  echo $2 PC$generatedhostname >> /etc/dnsmasq.hostsfile
13  pid=`pidof dnsmasq`
14  kill -HUP $pid 2> /dev/null
15fi
Note: See TracBrowser for help on using the repository browser.