Commit f5058ffd authored by Peter NORTHUP's avatar Peter NORTHUP

Adds minimal script (no domain join). Updates printer list.

parent add3a2a1
#!/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 with sudo from ~? 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
# change computer name
scutil --set HostName $hostname
scutil --set LocalHostName $hostname
scutil --set ComputerName $hostname
# set root password to proper one
passwd root
# enable SSH
systemsetup -setremotelogin on
# set scripts as executable
chmod 755 mountist.sh mac_install_printers.sh
# 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
......@@ -10,6 +10,9 @@ c4502unzip=${c4502finisher%.gz}
c4503path='/Library/Printers/PPDs/Contents/Resources/RICOH MP C4503.gz'
c4503finisher=${c4503path%.gz}\ Finisher.gz
c4503unzip=${c4503finisher%.gz}
c4504path='/Library/Printers/PPDs/Contents/Resources/RICOH MP C4504.gz'
c4504finisher=${c4504path%.gz}\ Finisher.gz
c4504unzip=${c4504finisher%.gz}
if [ ! -f "$c4502path" ] || [ ! -f "$c4503path" ];
then
......@@ -70,6 +73,19 @@ then
sudo gzip -v "$c4503unzip"
fi
# Verify that we have a special driver with the options
# finisher SR3150 (FinAMURBK) for c4504
# DefaultOptionTray -> 2Cassette (lower paper trays)
if [ ! -f "$c4504finisher" ];
then
sudo cp -p "$c4504path" "$c4504finisher"
sudo gunzip -v "$c4504finisher"
sudo sed -i '' 's/DefaultFinisher: NotInstalled/DefaultFinisher: FinAMURBK/g' "$c4504unzip"
sudo sed -i '' 's/DefaultOptionTray: NotInstalled/DefaultOptionTray: 2Cassette/g' "$c4504unzip"
sudo gzip -v "$c4504unzip"
fi
# Add the printers to the MAC. Should we loop through a file? Maybe... let's see
sudo lpadmin -p printer-I01-1st -D "Central Building 1st floor" -L "Central Building 1st floor" -E -v socket://p0117101.ista.local:9100 -P "$c4502finisher" -o printer-is-shared=false
sudo lpadmin -p printer-I01-2nd -D "Central Building 2nd floor" -L "Central Building 2nd floor" -E -v socket://p0117102.ista.local:9100 -P "$c4502finisher" -o printer-is-shared=false
......@@ -79,8 +95,14 @@ sudo lpadmin -p printer-I04-2nd -D "Bertalanffy Building 2nd floor" -L "Bertalan
sudo lpadmin -p printer-I04-3rd -D "Bertalanffy Building 3rd floor" -L "Bertalanffy Building 3rd floor" -E -v socket://p0417103.ista.local:9100 -P "$c4502finisher" -o printer-is-shared=false
sudo lpadmin -p printer-I03-gf -D "Admin Building ground floor" -L "Admin Building ground floor" -E -v socket://p0317100.ista.local:9100 -P "$c4502finisher" -o printer-is-shared=false
sudo lpadmin -p printer-I03-1st -D "Admin Building 1st floor" -L "Admin Building 1st floor" -E -v socket://p0317101.ista.local:9100 -P "$c4502finisher" -o printer-is-shared=false
sudo lpadmin -p printer-I06-gf -D "Lab Building East ground floor" -L "Lab Building East ground floor" -E -v socket://p0617100.ista.local:9100 -P "$c4504finisher" -o printer-is-shared=false
sudo lpadmin -p printer-I06-1st -D "Lab Building East 1st floor" -L "Lab Building East 1st floor" -E -v socket://p0617101.ista.local:9100 -P "$c4502finisher" -o printer-is-shared=false
sudo lpadmin -p printer-I06-2nd -D "Lab Building East 2nd floor" -L "Lab Building East 2nd floor" -E -v socket://p0617101.ista.local:9100 -P "$c4502finisher" -o printer-is-shared=false
sudo lpadmin -p printer-I21-gf -D "Office Building West ground floor" -L "Office Building West ground floor" -E -v socket://p2117100.ista.local:9100 -P "$c4503finisher" -o printer-is-shared=false
sudo lpadmin -p printer-I06-2nd -D "Lab Building East 2nd floor" -L "Lab Building East 2nd floor" -E -v socket://p0617102.ista.local:9100 -P "$c4502finisher" -o printer-is-shared=false
sudo lpadmin -p printer-I06-3rd -D "Lab Building East 3rd floor" -L "Lab Building East 3rd floor" -E -v socket://p0617103.ista.local:9100 -P "$c4502finisher" -o printer-is-shared=false
sudo lpadmin -p printer-I21-gf -D "Office Building West ground floor" -L "Office Building West ground floor" -E -v socket://p2117100.ista.local:9100 -P "$c4504finisher" -o printer-is-shared=false
sudo lpadmin -p printer-I21-o1 -D "Office Building West 1st floor" -L "Office Building West 1st floor" -E -v socket://p2117101.ista.local:9100 -P "$c4503finisher" -o printer-is-shared=false
sudo lpadmin -p printer-I21-o2 -D "Office Building West 2nd floor" -L "Office Building West 2nd floor" -E -v socket://p2117102.ista.local:9100 -P "$c4503finisher" -o printer-is-shared=false
sudo lpadmin -p printer-I21-o3 -D "Office Building West 3rd floor" -L "Office Building West 3rd floor" -E -v socket://p2117102.ista.local:9100 -P "$c4503finisher" -o printer-is-shared=false
sudo lpadmin -p printer-I21-bt2-o2 -D "Lab Building West 2nd floor" -L "Lab Building West 2nd floor" -E -v socket://p2117102.ista.local:9100 -P "$c4503finisher" -o printer-is-shared=false
rm -f ~/ricoh.pkg
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