フワシ。

ウオヘラ

Linux、ヒ、ニNIC、ホUp/Down、ケヤ、ヲ・ケ・ッ・・ラ・ネ。」
・ユ・ァ・、・・ェ。シ・ミ。シ、ホタレ、ツリ、ィタゥク貎靉、ホ・ム。シ・ト、ハ、ノ、ヒサネヘム、キ、゙、ケ。」

サネ、、ハ

ツ隹ーソ、ヒツミセン、ホ・、・・ソ。シ・ユ・ァ・、・ケ、サリト遙「ツ霹ーソ、ヒニーコ。ハUP / DOWN。ヒ、サリト熙キ、゙、ケ。」

  • eth0、UP
    ./nic-ctrl.sh eth0 UP

  • eth1、DOWN
    ./nic-ctrl.sh eth1 DOWN

・ウ。シ・ノ

  • nic-ctrl.sh
    #!/bin/sh
    # ----------------------------------
    #  Network Interface Up/Down Script
    # ----------------------------------
    # Version : 1.0
    # date    : 2008/04/16
    
    export LANG=C
    export PATH=/bin:/sbin:/usr/bin:/usr/sbin:$PATH
    
    # Set
    
    TARGET=$1
    ACTION=$2
    
    
    # Exec
    
    case $ACTION in
    UP)
     # Up Check
     ifconfig | grep $TARGET > /dev/null
     if [ $? = "0" ]; then
      echo $TARGET" is up - no action"
      exit 0
     fi
     # Interface Up
     ifup $TARGET
     # Up Check
     ifconfig | grep $TARGET > /dev/null
     if [ $? = "0" ]; then
      echo $TARGET" is up - Interface up success"
     else 
      echo $TARGET" is down - Interface up failed"
     fi
    ;;
    DOWN)
     # Down Check
     ifconfig | grep $TARGET > /dev/null
     if [ $? = "1" ]; then
      echo $TARGET" is down - no action"
      exit 0
     fi
     # Interface Down
     ifdown $TARGET
     # Down Check
     ifconfig | grep $TARGET > /dev/null
     if [ $? = "0" ]; then
      echo $TARGET" is up - Interface down failed"
     else
      echo $TARGET" is down - Interface down success"
     fi
    ;;
    *)
     echo "ERR: Script Setting Error"
    ;;
    esac
    
    
    exit 0
    # EOF

・ネ・テ・ラ   ハヤスク ナ犢 コケハャ 写酌識失竺識捨釈 ナコノユ ハ」タス フセチーハムケケ ・・。シ・ノ   ソキオャ ーヘ ク。コ コヌスェケケソキ   ・リ・・ラ   コヌスェケケソキ、ホRSS
Last-modified: 2009-12-15 (イミ) 11:17:25 (5189d)