#!/bin/sh

	ftpfs=`cat /etc/ftpfs`

	if [ $ftpfs = True ]; then
		echo "starting ftpfs"

		ip=`cat /etc/ftpfs.ip`
		port=`cat /etc/ftpfs.port`
		privat=`cat /etc/ftpfs.privat`
		user=`cat /etc/ftpfs.user`
		pass=`cat /etc/ftpfs.pass`
		ssl=`cat /etc/ftpfs.ssl`
		opt="-o nonempty -o kernel_cache -o auto_cache -o disable_epsv -o skip_pasv_ip"
		if [ $ssl = True ]; then
			sslout="-o ssl -o no_verify_peer -o no_verify_hostname"
		fi
		
		if [ $privat = False ]; then
			user="anonymous"
			pass="fake@web.de"
			sslout=""
		fi
		
		curlftpfs $opt $sslout $user:$pass@$ip:$port /media/ftp/ftp-automount
	fi

echo "netfs done"
  