Install Mojave script in self service - need your help

atomczynski
Valued Contributor

I have the following script which worked migrating 10.13.x to 10.14.5

#!/bin/bash

/Applications/Install macOS Mojave.app/Contents/Resources/startosinstall --applicationpath /Applications/Install macOS Mojave.app --agreetolicense --nointeraction

currUser=$(scutil <<< "show State:/Users/ConsoleUser" | awk -F': ' '/[[:space:]]+Name[[:space:]]:/ { if ( $2 != "loginwindow" ) { print $2 }} ')
currUserUID=$(id -u "$currUser")

/bin/launchctl asuser "$currUserUID" sudo -iu "$currUser" killall "Self Service"

exit 0

however it is not working anymore
I took out application path so the script looks like this now:

#!/bin/bash

/Applications/Install macOS Mojave.app/Contents/Resources/startosinstall --agreetolicense --nointeraction

currUser=$(scutil <<< "show State:/Users/ConsoleUser" | awk -F': ' '/[[:space:]]+Name[[:space:]]:/ { if ( $2 != "loginwindow" ) { print $2 }} ')
currUserUID=$(id -u "$currUser")

/bin/launchctl asuser "$currUserUID" sudo -iu "$currUser" killall "Self Service"

exit 0

but still nothing happens.

Thoughts?

4 REPLIES 4

babaganouj
New Contributor II

Make sure you are using an Apple installer with an update certificate as It expired recently.

Try running the Apple installer manually to see if you get an error like: "This copy of the Install macOS Mojave.app application is damaged, and can’t be used to install macOS". If you get something like this then download a new installer and try your script again after.

cdenesha
Valued Contributor II

try switching the --nointeraction and the --agreetolicense switches. I for the first time set up Mojave in Self Service and couldn't get it to work in the order you have listed it. It could be just me though.

atomczynski
Valued Contributor

For sure I'm having problems downloading the current installer.
I have done this several times (while on this network) and now I have done it through the App Store on the device I'm working on.

I think I'm running into the issue where the app is being downloaded from an internal caching server.
I have a few of those and will need to erase their cached content.

Rohitds14
New Contributor III

This works for me as postinstall.

#!/bin/sh
/Applications/Install macOS Mojave.app/Contents/Resources/startosinstall --agreetolicense