ElEsido wrote: 
> Danke für das Angebot, mein Script anzuschauen, das wäre sehr nett. Eilt
> aber nicht. 
> 

I am not a Big Fan for usernames and passwords in a shellscript - that
mount should be in /etc/fstab...
Since i have no clue about that squeezeplug (ask Truehl) i leave that
line even when i -hate- / dont like the unsecure "welcome scriptkiddy"
scripts.

I EVEN HAVE NO CLUE WHY THAT SLEEP IS ADDED - SO I LEAVE IT WHEN ITS
MOUNTED BUT OTHER THATN SLEEP AFTER THE RSYNC - WE USE THE TIME THAT
CHOWN NEEDS AS YOUR SLEEP.


Code:
--------------------
    #!/bin/bash
  
  #vars:
  ### change that:
  myuser=squeezeplug
  
  sync_lib(){
  echo "/timecapsule is mounted"
  sleep 15s
  echo "starting rsync
  rsync -rtuv --delete /timecapsule/ /data/
  echo "syncronization complete"
  echo "Changing ownership of music to user $myuser and group music."
  chown -hR $myuser:music /data
  echo "ownership changed"
  umount /timecapsule
  echo "timecapsule unmounted."
  echo "Now its Time for a rescan"
  squeezeboxserver-scanner --rescan --novideo --noimage
  echo "exiting. Enjoy the music."
  }
  
  
  if [ "$(whoami)" != "root" ]
  then
  echo "we must run as root"
  sudo $0 && exit 1
  fi
  
  mount -t smbfs -o  
username=squeezeplug,password=AbleArtist96,iocharset=utf8,codepage=unicode,unicode
 //192.168.1.1/Data/Musik /timecapsule
  
  grep "/timecapsule" /etc/mtab && sync_lib ||echo "ERROR - cant mount - 
Stopping without doing anything"
  exit
--------------------



Gruss
Jan
------------------------------------------------------------------------
DJanGo's Profile: http://forums.slimdevices.com/member.php?userid=1516
View this thread: http://forums.slimdevices.com/showthread.php?t=105030

_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/unix

Reply via email to