Commit add3a2a1 authored by 's avatar

Breaking into Admin and User scripts.

parent 39662169
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
#!/bin/sh
# Set up a fresh Macbook for IST. Run with sudo!
# run from /Users/Shared/mac-scripts
# note: slow login may be helped by putting IPs of domain controllers: DC1, W1521003, W1521007
echo "Are you running this from the future user's account? If not, cancel now..."
function enter_yesno {
while true ; do
echo -n "${1} (Y/N)? " 1>&2
read -n 1 reply
echo
case "$reply" in
Y*|y*) return 0 ;;
N*|n*) return 1 ;;
esac
echo "Invalid input, try again ..." 1>&2
done
}
# hostname = "USER INPUT"
read -p "Enter hostname (e.g. 'mnadmn001'): " hostname
# username = "USER INPUT"
read -p "Enter future username: " username
# admuser = "USER INPUT"
read -p "Enter your AD admin username: " admuser
# admgroup = "USER INPUT"
read -p "Enter an AD group that should have admin access, if any (besides Domain Admins) - e.g. 'itgrp': " admgroup
# printer = "USER INPUT"
# read -p "Enter the building and floor, for default printer selection, if any. E.g. 'i21.eg' for Office West Ground Floor: " printer
# set scripts as executable
chmod 755 com.user.loginscript.plist mountist.sh mac_install_printers.sh
# root needs to own all-user LaunchAgents
chown root com.user.loginscript.plist
# loginscript.plist runs mountist.sh for all users on login
cp com.user.loginscript.plist /Library/LaunchAgents/com.user.loginscript.plist
# download, install browser certificates / istwlan cert
curl -O https://git.ist.ac.at/support/software/raw/master/IST.CA.CRT.pem
curl -O https://git.ist.ac.at/support/software/raw/master/IST-Austria-Root-CA01.crt
security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain IST-Austria-Root-CA01.crt
security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain IST.CA.CRT.pem
rm IST.CA.CRT.pem
rm IST-Austria-Root-CA01.crt
# download, install OCS
# waiting on Thomas to update this
# download, install Tunnelblick - install config files?
curl -O https://git.ist.ac.at/support/software/raw/master/Tunnelblick.app.zip
unzip Tunnelblick.app.zip > /dev/null
mv Tunnelblick.app /Applications
rm Tunnelblick.app.zip
# download, install SeaFile
curl -O https://git.ist.ac.at/support/software/raw/master/Seafile.app.zip
unzip Seafile.app.zip > /dev/null
mv Seafile\ Client.app /Applications
rm Seafile.app.zip
# download, install MacPass
curl -O https://git.ist.ac.at/support/software/raw/master/MacPass.zip
unzip MacPass.zip > /dev/null
mv MacPass.app /Applications
rm MacPass.zip
# download printers, install
# when domain-joined adding printers is easy
if enter_yesno "Install printers?"
then
./mac_install_printers.sh
fi
if enter_yesno "Install common programs?"
then
./install-common-programs.sh
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment