[Owncloud] ownsync, existing?

dal dal_ml at me.com
Fri Dec 9 00:23:07 UTC 2011


Hello everybody,

I just wanted to polish the script and make it run-able under linux, too.

Therefore I included the gvfs-mount command and separated the mounting processes by platform.
Somehow I got stuck; I think I'm totally not used to bash-scripting :(

The problem is, that .gvfs mounts it's volumes into "~/.gvfs/share on server" or even worse when localized "~/.gvfs/share auf server".
This means that the mountpoint is barely predictable and needs to be looked up e.g. by the means of:
	gvfs-mount -l | grep smb://user@host/share/
This will produce:
	Mount(0): user on server -> smb://user@host/share/
or in case of WebDAV
	Mount(0): WebDAV as user on my.tld -> davs://user@my.tld/cloud/files/webdav.php

It's ridiculous but I'm not able to parse those lines!

The routine itself looks somewhat like this:

		gvfs-mount ${SAMBA_PROTOCO}L${SAMBA_PATH}						#works
		cmd="gvfs-mount -l | grep "${SAMBA_PROTOCOL}${SAMBA_PATH}"			#works
		DAVMOUNT=`eval $cmd`													#works
					
		#cmd= "echo $DAVMOUNT | awk  '{ print \$2 \$3 \$4}'"						#this blows my mind!
		#...
The problem is, that I'm simply unable to embed the correct awk statement into an veal and assign the result to a variable.
Using the terminal the following statement works:
		echo "Mount(0): user on server -> smb://user@host/share/" | awk '{ print $2" "$3" "$4}'

Anyone out there with major bash/awk/sed/grep/egrep-skills who could help me out?

Kind Regards,
Dorian


-------------- next part --------------
A non-text attachment was scrubbed...
Name: syncOwncloud.sh
Type: application/octet-stream
Size: 6256 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/owncloud/attachments/20111209/adc160a0/attachment.obj>


More information about the Owncloud mailing list