#!/bin/ash defaultprotocol=`cat /configs/dav/crestuser` 2>/dev/null defaultuser=`cat /configs/dav/davuser` 2> /dev/null clear echo "Welcome to LightDesktop" echo "You may enter 'dav' or 'none' for username to mount a WebDAV home, or none at all" echo read -p "Username: [$defaultprotocol]" protocol if [ ! "$protocol" ] then protocol="$defaultprotocol" fi if [ "$protocol" = "none" ] then echo "No home directory set." exit fi if [ "$protocol" != "dav" ] then stty -echo read -p "Password: " passwd stty echo echo "" echo "home.lightdesktop.com/$protocol" > /tmp/crestauth.NEW echo $protocol >> /tmp/crestauth.NEW echo $passwd >> /tmp/crestauth.NEW mv /tmp/crestauth.NEW /tmp/crestauth #export HOME="/http/home.lightdesktop.com/$protocol" echo "/http/home.lightdesktop.com/$protocol" > /tmp/homedir if [ ! -d /configs/dav ] then mkdir /configs/dav fi echo "$protocol" > /configs/dav/crestuser if [ `readlink /home` != "/http/home.lightdesktop.com/$protocol" ] then rm /home ln -sf "/http/home.lightdesktop.com/$protocol" /home fi else defaulturl=`cat /configs/dav/davurl` 2> /dev/null if [ ! "$defaulturl" ] then defaulturl="none" fi read -p "DAV share URL (or type 'none' for none)? [$defaulturl]: " davurl if [ ! "$davurl" ] then davurl="$defaulturl" fi if [ "$davurl" != "none" ] then read -p "DAV share username [$defaultuser] ? " davuser if [ ! "$davuser" ] then davuser="$defaultuser" fi stty -echo echo -n "What is the password for your DAV share? " read davpasswd stty echo echo "" if [ ! -d /configs/dav ] then mkdir /configs/dav fi echo "$davurl" > /configs/dav/davurl echo "$davuser" > /configs/dav/davuser echo "$davurl $davuser $davpasswd" > /etc/davfs2/secrets chmod 0600 /etc/davfs2/secrets mount.davfs $davurl /home echo "/home/" > /tmp/homedir #export HOME="/home" fi fi