Get Erase-install.sh working

binjali
Contributor

So, i'm trying to use https://github.com/grahampugh/erase-install and I'm having a VERY hard time understanding the steps to make it work.

I added the package to Jamf Cloud, and pushed it out to my test computers by policy.

How doi I get the various switches into the install? I thought i could make separate polices that included scripts that talk to the installed package. Is this the correct usage?

14 REPLIES 14

sdagley
Esteemed Contributor II

@binjali Did you review the Jamf Pro section in the erase-install Wiki? https://github.com/grahampugh/erase-install/wiki/8.-Use-in-Jamf-Pro

 

jcarr
Release Candidate Programs Tester

I have a Self Service policy that installs the package and then runs the following command using the 'Files and Processes' payload:

 

/Library/Management/erase-install/erase-install.sh --reinstall --os=12 --update --min-drive-space=35 --current-user --check-power --no-fs --depnotify --cleanup-after-use

 

Obviously you can change the --update flag if you want to do an erase and install.

binjali
Contributor

So, i used the erase-install.sh script, pushed and activated by policy, and pushed it out to my two current test machines.  They ran the updates as requested, but I lost the JamfConnect login window.   The update polic isn't registering as completed, the test machines are just sitting in pending, and when I tired to push out an auth-changer policy, it is also sitting in pending, with no progress being made.  I need help with this.

Did you ever get to the bottom of this?

Eh, not really. Got pulled off by a series of cascading fires and haven't been able to get back.  Maybe i'll get to understand this one day.

pinsent
New Contributor III

I'm now facing this same scenario. I'm wondering if adding

authchanger -reset -JamfConnect

to the beginning of the script wouldn't do the trick. I'll test it out and let you know.

pinsent
New Contributor III

This approach seems to work

b_rant
New Contributor II

It seems like any Major OS upgrade will cause the Jamf Connect window to disappear. 

What I did to resolve this was create a policy that runs the a script to reset authchanger on login.
I actually have this ongoing, since the JC window likes to disappear on me for unknown reasons besides the upgrade.

Script to run

 

authchanger -reset -JamfConnect

 

 This could likely also be run from the Execute Command field in Files & Processes.

After they login for first time without the JC window it should come back.
There may be other solutions to this issue but this works for me.

SMR1
Contributor III

Trying this package for the first time. I have the package install and setup the file and process set to

/Library/Management/erase-install/erase-install.sh --reinstall --update --min-drive-space=35 --current-user --check-power --no-fs --cleanup-after-use, but it errors because it can't obtain valid installer. Cannot continue.

 

Build 21G115 selected. Downloading #27...

Making empty sparseimage...

[run_installinstallmacos] Error obtaining valid installer. Cannot continue.

[erase-install] attempting to terminate the 'caffeinate' process - Termination message indicates success /Library/Management/erase-install/erase-install.sh: line 1078: 36060 Terminated: 15 /usr/bin/caffeinate -dimsu -w $$

[erase-install] attempting to terminate the 'jamfHelper' process - Termination message indicates success /Library/Management/erase-install/erase-install.sh: line 1078: 36083 Terminated: 15 "$jamfHelper" -windowType hud -windowPosition ul -title "${!dialog_dl_title}" -alignHeading center -alignDescription left -description "${!dialog_dl_desc}" -lockHUD -icon "$dialog_dl_icon" -iconSize 100

sdagley
Esteemed Contributor II

@SMR1 Try adding the "--pkg" option to have erase-install download the installer as a .pkg instead of build one.

I'd also suggest adding the option "--build=21G115" if you specifically want 12.6 to be installed.

SMR1
Contributor III

Thanks. I had to use the --pkg option,because we use DLP and it was blocking the saving of the .dmg, but when I used the --pkg option it worked.

SMR1
Contributor III

For M1's, if we utilize bootstrap tokens, will it bypass the user prompt to enter password? 

sdagley
Esteemed Contributor II

@SMR1 The bootstrap token will allow Jamf Pro to trigger an update via an MDM command, but it cannot be used for a scripted update such as erase-install.

SMR1
Contributor III

That's what I thought, but thought I would check. Thanks for the assistance.