Sophie

Sophie

distrib > Mageia > 7 > i586 > by-pkgid > bfb1f3780007b1f6c636a14c149f3765 > files > 6

dhcpxd-1.0.3-33.mga7.i586.rpm

#! /bin/sh

# This is a sample global plug-in for ifcfg.def script.
# It will update ooo.dhs.org where ooo is the user_id.
# To enable a hostname update to ooo.dhs.org simply create
# the file INTERFACE.dhs-update with the lines:
# 
# user_id="Your account name at dhs.org"
# password="Your password at dhs.org"
#
# You may specify the following as well
# DHS_HOSTNAME="Your hostname on dhs"    #default is one received by DHCPXD
# DHS_DOMAIN="The domain on dhs"         #default is dhs.org itself
# DHS_TYPE="dynamic|static"              #default is static
# DHS_WILDCARD=y|n                       #default is y
# DHS_MX="netname-for-your-mail.com"     #default is none
#
# Big thanks to Tarb for this script.

VAR=""
[ "$1 $ACTION" = "post open" ] && VAR="1"
[ "$1 $ACTION" = "post update" ] && [ "$CURRENTIP" != "$IP" ] && VAR="1"

if [ "$VAR" ] ; then
  if [ -f "$MAINPATH/$INTERFACE.dhs-update" ] ; then
    DHS_IP="$IP"
    DHS_DOMAIN="dhs.org"
    DHS_HOSTNAME="$HOSTNAME"
    DHS_TYPE="static"
    DHS_WILDCARD="n"
    DHS_MX=""

    source "$MAINPATH/$INTERFACE.dhs-update" $*

    if [ "$DHS_USER" ] && [ "$DHS_PASSWORD" ] ; then
      [ "$DHS_TYPE" == "static" ] && DHS_TYPE="1"
      [ "$DHS_TYPE" == "dynamic" ] && DHS_TYPE="4"

      DHS_URL="http://members.dhs.org/dhs/nic/hosts?hostscmd=edit\&hostscmdstage=2"
      DHS_URL="$DHS_URL\&type=$DHS_TYPE"
      DHS_URL="$DHS_URL\&domain=$DHS_DOMAIN"
      DHS_URL="$DHS_URL\&hostname=$DHS_HOSTNAME"
      DHS_URL="$DHS_URL\&ip=$DHS_IP"
      DHS_URL="$DHS_URL\&wildcard=$DHS_WILDCARD"
      DHS_URL="$DHS_URL\&mx=$DHS_MX"

      lynx -source -auth="$DHS_USER":"$DHS_PASSWORD" "$DHS_URL" > /dev/null &
    fi
  fi
fi