Перейти из форума на сайт.

НовостиФайловые архивы
ПоискАктивные темыТоп лист
ПравилаКто в on-line?
Вход Забыли пароль? Первый раз на этом сайте? Регистрация
Компьютерный форум Ru.Board » Операционные системы » UNIX » Новичок в GNU/Linux’е

Модерирует : ShriEkeR

articlebot (03-11-2017 08:01): Новичок в GNU/Linux’е.  Версия для печати • ПодписатьсяДобавить в закладки
На первую страницук этому сообщениюк последнему сообщению

   

king_stiven

Silver Member
Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору
#!/bin/sh
 
#loading driver for accessing Windows shares
insmod /mtd_rwarea/SamyGO/modules/cifs.ko
 
#creating and mounting shares from Windows server
VUSB="/dtv/usb/sda4" #this will be root directory for all shares
SERVER="192.168.0.158" #this is server with shares
USER=user #Windows PC username which should see share's contents
PASS= #in my case password is not needed
 
#list of shares
SHARE1=Films
 
#if share server is down, we do not connect shares
#if we do - it will cause shutdown problems
 
ping -c 1 $SERVER #pinging shares server
if [ "$?" = "0" ] ; then #if ping was successful
 
#make shares root directory
mkdir -p $VUSB  
 
#make all shares directories and mount resources to them
i=1
while [ $i -le 20 ] #increase it if you have more than 20 shares
do
  share_name="SHARE${i}"
  eval share=\$${share_name}
  #exit cycle on empty variable
  if [ -z $share ]; then
    break
  fi
  #make empty directory for share mounting
  mkdir "$VUSB/$share"
  #mount shared resource to newly created folder  
  mount -o user=$USER,password=$PASS -t cifs "//$SERVER/$share" "$VUSB/$share"
  #evaluating next value
  i=`expr $i + 1`
done
         
 
#showing shares through virtual USB
#don't know what happens here or is it effective way, but it works
 
dd if=/dev/zero of=/dtv/vusb bs=512 count=4
insmod /mtd_rwarea/SamyGO/modules/dummy_hcd.ko
sleep 2
insmod /mtd_rwarea/SamyGO/modules/g_file_storage.ko
sleep 3
 
#you can change "PC" below to other name if you wish. it will be presented on TV
echo -e "[sda]
Vendor : CifsMount
Product : PC
Serial : Q80VQLFH
Devpath : 8
Lun : 0
MountDir : /dtv/usb/sda4
FileSystem : vfat
" >> /dtv/usb/log
 
else
  echo "Server is not reachable. Will not mount shares"  
fi

Всего записей: 2229 | Зарегистр. 17-07-2006 | Отправлено: 17:50 23-10-2013
   

На первую страницук этому сообщениюк последнему сообщению

Компьютерный форум Ru.Board » Операционные системы » UNIX » Новичок в GNU/Linux’е
articlebot (03-11-2017 08:01): Новичок в GNU/Linux’е.


Реклама на форуме Ru.Board.

Powered by Ikonboard "v2.1.7b" © 2000 Ikonboard.com
Modified by Ru.B0ard
© Ru.B0ard 2000-2024

BitCoin: 1NGG1chHtUvrtEqjeerQCKDMUi6S6CG4iC

Рейтинг.ru