· KLDP.org · KLDP.net · KLDP Wiki · KLDP BBS ·
GentooX86 Handbook_Ko_4-5

1. ±â´ÉÀû Ãß°¡

1.1. Ç¥ÁØ ÇÔ¼ö ÈÅ

start/stop µ¿ÀÛ ÁÖº¯¿¡ ÀÖ´Â ³×°³ÀÇ ÇÔ¼ö°¡ Á¤ÀÇµÉ ¼ö ÀÖ½À´Ï´Ù. ÇÔ¼öµéÀº ÀÎÅÍÆäÀ̽º À̸§ÀÌ ¸ÕÀú¿Í¼­ ÇϳªÀÇ ÇÔ¼ö·Î ÇÏ¿©±Ý ´ÙÁß ¾îÅÇÅ͸¦ Á¦¾îÇÒ ¼ö ÀÖ½À´Ï´Ù.

preup()°ú predown() ÇÔ¼öÀÇ ¹Ýȯ°ªÀº ÀÎÅÍÆäÀ̽ºÀÇ È¯°æ¼³Á¤/ÇØÁ¦°¡ °è¼ÓµÉ ¼ö ÀÖ´Â 0(¼º°ø)ÀÌ µÉ °ÍÀÔ´Ï´Ù. ¸¸¾à preup()ÀÌ 0ÀÌ ¾Æ´Ñ °ªÀ» ¸®ÅÏÇϸé ÀÎÅÍÆäÀ̽º ȯ°æ¼³Á¤Àº Áß´ÜµÉ °ÍÀÔ´Ï´Ù. predown()ÀÌ 0ÀÌ ¾Æ´Ñ °ªÀ» ¹ÝȯÇϸé ÀÎÅÍÆäÀ̽º´Â ȯ°æ¼³Á¤ Ãë¼Ò°¡ ´õÀÌ»ó ÁøÇàµÇÁö ¾ÊÀ» °ÍÀÔ´Ï´Ù.

postup()°ú postdown()ÇÔ¼öÀÇ ¹Ýȯ°ªÀº ½ÇÆСÈĸ¦ º¸ÀÎ´Ù¸é ¾Æ¹«°Íµµ ¾ÈÇϱ⠶§¹®¿¡ ¹«½ÃµË´Ï´Ù.

${IFACE} ´Â ÀÎÅÍÆäÀ̽º°¡ up/downµÇ´Â °ÍÀ» ¼³Á¤ÇÕ´Ï´Ù. ${IFVAR}´Â ${IFACE} °¡ ¹è½Ã¿¡¼­ Çã¿ëÇÏ´Â º¯¼ö·Î º¯ÇüµÈ °ÍÀÔ´Ï´Ù.

¿¹Á¦ 1-1: pre/post up/down ÇÔ¼ö ¿¹Á¦
preup() {
  # Test for link on the interface prior to bringing it up.  This
  # only works on some network adapters and requires the ethtool
  # package to be installed.
  if ethtool ${IFACE} | grep -q 'Link detected: no'; then
    ewarn "No link on ${IFACE}, aborting configuration"
    return 1
  fi

  # Remember to return 0 on success
  return 0
}

predown() {
  # The default in the script is to test for NFS root and disallow
  # downing interfaces in that case.  Note that if you specify a
  # predown() function you will override that logic.  Here it is, in
  # case you still want it...
  if is_net_fs /; then
    eerror "root filesystem is network mounted -- can't stop ${IFACE}"
    return 1
  fi

  # Remember to return 0 on success
  return 0
}

postup() {
  # This function could be used, for example, to register with a
  # dynamic DNS service.  Another possibility would be to
  # send/receive mail once the interface is brought up.
       return 0
}

postdown() {
  # This function is mostly here for completeness... I haven't
  # thought of anything nifty to do with it yet ;-)
  return 0
}

1.2. ¹«¼± µµ±¸ ÇÔ¼ö ÈÅ

À¯ÀÇ»çÇ×: WPA ¿äû°ú´Â µ¿ÀÛÇÏÁö ¾ÊÀ» °ÍÀÔ´Ï´Ù. ±×·¯³ª ${ESSID} ¿Í ${ESSIDVAR} º¯¼öµéÀº postup() ÇÔ¼ö³»¿¡¼­ »ç¿ë °¡´ÉÇÕ´Ï´Ù.

Âü¿© µ¿ÀÛ ÁÖº¯¿¡ ÀÖ´Â ³×°³ÀÇ ÇÔ¼ö°¡ Á¤ÀÇµÉ ¼ö ÀÖ½À´Ï´Ù. ÇÔ¼öµéÀº ÀÎÅÍÆäÀ̽º À̸§ÀÌ ¸ÕÀú¿Í¼­ ÇϳªÀÇ ÇÔ¼ö·Î ÇÏ¿©±Ý ´ÙÁß ¾îÅÇÅ͸¦ Á¦¾îÇÒ ¼ö ÀÖ½À´Ï´Ù.

preassociate() ÇÔ¼öÀÇ ¹Ýȯ°ªÀº ¾ÕÀ¸·Îµµ °è¼Ó ÀÎÅÍÆäÀ̽ºÀÇ È¯°æ¼³Á¤/ÇØÁ¦°¡ °¡´ÉÇÒ¶§ 0(¼º°ø)À» ¹ÝȯÇÒ °ÍÀÔ´Ï´Ù. ¸¸¾à preassociate()°¡ 0ÀÌ ¾Æ´Ñ °ªÀ» ¸®ÅÏÇÏ°Ô µÇ¸é ȯ°æ¼³Á¤Àº Áß´ÜµÉ °ÍÀÔ´Ï´Ù.

postassociate() ÇÔ¼öÀÇ ¹Ýȯ°ªÀº ÀÌ»óÁõ¼¼°¡ ¹ß°ßµÉ °æ¿ì ¾Æ¹«°Íµµ ¾ÈÇϱ⠶§¹®¿¡ ¹«½ÃµË´Ï´Ù.

${ESSID} ´Â ¿¬°áÇÏ°íÀÚÇÏ´Â APÀÇ Á¤È®ÇÑ ESSID¿¡ ¸ÂÃçÁý´Ï´Ù. ${ESSIDVAR}Àº ${ESSID}°¡ ¹è½Ã¿¡¼­ Çã¿ëÇÏ´Â º¯¼ö·Î º¯È¯µÈ °ÍÀÔ´Ï´Ù.

¿¹Á¦ 2-2 : pre/post Âü¿© ÇÔ¼ö
preassociate() {
  # The below adds two configuration variables leap_user_ESSID
  # and leap_pass_ESSID. When they are both configured for the ESSID
  # being connected to then we run the CISCO LEAP script

  local user pass
  eval user=\"\$\{leap_user_${ESSIDVAR}\}\"
  eval pass=\"\$\{leap_pass_${ESSIDVAR}\}\"

  if [[ -n ${user} && -n ${pass} ]]; then
    if [[ ! -x /opt/cisco/bin/leapscript ]]; then
      eend "For LEAP support, please emerge net-misc/cisco-aironet-client-utils"
      return 1
    fi
    einfo "Waiting for LEAP Authentication on \"${ESSID//\\\\//}\""
    if /opt/cisco/bin/leapscript ${user} ${pass} | grep -q 'Login incorrect'; then
      ewarn "Login Failed for ${user}"
      return 1
    fi
  fi

  return 0
}

postassociate() {
  # This function is mostly here for completeness... I haven't
  # thought of anything nifty to do with it yet ;-)

  return 0
}

À¯ÀÇ»çÇ× : ${ESSID}¿Í ${ESSIDVAR} Àº predown()°ú postdown()ÇÔ¼ö¿¡¼­ »ç¿ë ºÒ°¡´ÉÇÕ´Ï´Ù.


ID
Password
Join
You will be successful in love.


sponsored by andamiro
sponsored by cdnetworks
sponsored by HP

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2009-02-22 23:00:45
Processing time 0.0047 sec