¿ù°£ Àα⠰Խù°

°Ô½Ã¹° 56°Ç
   
SAMBA ¸¶¿îÆ® ½ºÅ©¸³Æ®
±Û¾´ÀÌ : ÃÖ°í°ü¸®ÀÚ ³¯Â¥ : 2011-02-23 (¼ö) 12:43 Á¶È¸ : 5792
±ÛÁÖ¼Ò :
                          

»ï¹Ù·Î Ÿ¼­¹ö¸¦ ¸¶¿îÆ® °É±âÀ§ÇØ ÀÛ¼º 
#!/bin/bash
# Source function library.
. /etc/init.d/functions
prog="SAMBA_MOUNT"
RETVAL=0
 
### »ï¹Ù¸¶¿îÆ® Á¢±ÙÁ¤º¸ ###
username="XXXXXXX"
password="XXXXXXX"
backup_serverip="XXX.XXX.XXX.XXX"
Backup_DIR="/SAMBA_MOUNT"   # ¸¶¿îÆ®ÇÒ µð·ºÅ丮

if [ ! -d $Backup_DIR ]; then
        mkdir $Backup_DIR
fi

start (){
        echo -n $"Starting $prog: "
       mount_check=`mount |grep $Backup_DIR`
        if [ "$mount_check" = "" ] ; then
               mount.cifs //$backup_serverip/$username $Backup_DIR -o username=$username,password=$password,iocharset=utf8,codepage=cp949,dir_mode=0755,file_mode=0666,noperms
        else
                echo " ÀÌ¹Ì ¸¶¿îÆ® µÇ¾îÀÖ½À´Ï´Ù."
        fi;
        echo
        return $RETVAL
}
stop (){
        echo -n $"Stopping $prog: "
        mount_check=`mount |grep  $Backup_DIR`
        if [ "$mount_check" = "" ] ; then
                echo "ÇöÀç ¸¶¿îÆ® µÇ¾îÀִ°÷ÀÌ ¾ø½À´Ï´Ù."
        else
        umount $Backup_DIR
        fi;
        echo
        return $RETVAL
}

restart(){
        stop
        start
}
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        restart
        ;;
  *)
        echo $"Usage: $0 {start|stop|restart}"
        RETVAL=1
esac
exit $RETVAL

À̸§ Æнº¿öµå
ºñ¹Ð±Û (üũÇÏ¸é ±Û¾´À̸¸ ³»¿ëÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.)
¿ÞÂÊÀÇ ±ÛÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä.
   

 



 
»çÀÌÆ®¸í : ¸ðÁö¸®³× | ´ëÇ¥ : ÀÌ°æÇö | °³ÀÎÄ¿¹Â´ÏƼ : ·©Å°´åÄÄ ¿î¿µÃ¼Á¦(OS) | °æ±âµµ ¼º³²½Ã ºÐ´ç±¸ | ÀüÀÚ¿ìÆí : mojily°ñ¹ðÀÌchonnom.com Copyright ¨Ï www.chonnom.com www.kyunghyun.net www.mojily.net. All rights reserved.