#!/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 |