#!/bin/bash
#
# install_cbs
#

BASEURL="ftp://instantafs.cbs.mpg.de/instantafs/collection/clients/macosx"

# Installing AFS...
cd /tmp
#curl -O "$BASEURL/install_afs"
chmod 755 install_afs
./install_afs

# Configuring automounter...
mkdir -p "/Library/Startupitems"
curl "$BASEURL/config/automount.tar" | tar x


/Library/Startupitems/Automount/Automount stop
/Library/Startupitems/Automount/Automount start

curl -o /institute.png "$BASEURL/config/institute.png"

defaults delete /Library/Preferences/com.apple.loginwindow autoLoginUser
defaults delete /Library/Preferences/com.apple.loginwindow autoLoginUserUID
defaults write /Library/Preferences/com.apple.loginwindow showInputMenu -bool true
defaults write /Library/Preferences/com.apple.loginwindow DesktopPicture -string /institute.png
defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText -string "Max Planck Institute for Human Cognitive and Brain Sciences"
defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo -string HostName
defaults write /Library/Preferences/com.apple.loginwindow SHOWFULLNAME -bool true

echo "ServerName cupsserv.cbs.mpg.de" > /etc/cups/client.conf
