I am working on making a script that will mount a smb share off a server, copy all the packages out of a folder to the laptop, then install these packages.
There are two parts I need help with.
The first, This is going to be used at many different locations. The ip address formula is the same at all locations so rather then make a bunch of different scripts i wanted to get the ip address of the computer and using that to mount the share.
The address of the computer and the share have a formula. 124.30.location number.computer number
the first two ip octet are always the same for both the server and the laptop. so lets say that is 124.30.
the third octet varies by location, but is the same on both the server and the laptop at that location. so if you get the ip address of the laptop you cat get the first three octets of the server address.
The server always has the same computer number at every location 124.30.location.40
So using this info and what I have created below, it should be abled to be modified to work.
The second thing i need help with is, rather then list out each package to install, is there a way to read the packages in the folder once it is copied over and install them based on that?
#!/bin/sh
ifconfig en0 | grep 124.30.?.135
mkdir /Volumes/MacUpdates
mount_smbfs //User:password@124.30.?.40/MacUpdates /Volumes/MacUpdates
mkdir /Users/Shared/MacUpdates
cp /Volumes/MacUpdates/* /Users/Shared/MacUpdates/
sudo installer -pkg /Users/Shared/MacUpdates/Java1.4.1.pkg -target /