JamfProScripts icon indicating copy to clipboard operation
JamfProScripts copied to clipboard

download_jss_scripts.sh downloads are empty

Open smashism opened this issue 6 years ago • 5 comments

Heya, when running the download_jss_scripts.sh script all the files being downloaded are totally empty. I also get this error for each script:

DEBUG: Script name is: Microsoft Lync Uninstall
DEBUG: Script extension is: Microsoft Lync Uninstall
Downloaded script "Microsoft Lync Uninstall.sh"...
-:10: parser error : Opening and ending tag mismatch: br line 8 and p
</p>
    ^
-:11: parser error : Opening and ending tag mismatch: p line 8 and body
</body>
       ^
-:12: parser error : Opening and ending tag mismatch: body line 5 and html
</html>
       ^
-:13: parser error : Premature end of data in tag html line 1

^

Since I get that for each script download attempted it does not seem to be an issue with the scripts themselves since they can't all be completely identical.

smashism avatar Jan 15 '18 15:01 smashism

Hey Emily, thanks for the heads up. Been a while since I worked these scripts against a current Jamf Pro setup. I will take a look at it and see what needs to be updated. Just so I know I'm working against the correct setup, what version of Jamf Pro are you running it against that's throwing those errors?

mm2270 avatar Jan 15 '18 18:01 mm2270

@smashism Ok, never mind. I was able to find the issue. Oddly enough, the problem was mostly from the curl header -H "Accept: application/xml" being after the -u flag for the username/password credentials. I don't know why, but placing it first addressed the main issue. I also cleaned up the script a little. Change on line 156 from using xmllint and passing the results through a bunch of crazy sed commands to get the script contents. It now uses xpath and goes right to script_contents to get just the script by itself. Much cleaner.

The script is now updated with the above changes. Please give it a try and let me know when you have time if it's working for you now.

mm2270 avatar Jan 15 '18 19:01 mm2270

Worked swimmingly!

Is it possible that similar tweaks might be required by the EA download as well? I have a few EAs that skip some lines on the download/save for some reason, not sure why 🤔

smashism avatar Jan 15 '18 21:01 smashism

Yes, I might need to go look at that script as well as they use similar code to pull down the script content. Glad this one is working now though!

mm2270 avatar Jan 15 '18 21:01 mm2270

I've copied this script from the main page and I'm running into the same issue that the OP ran into... I haven't made any changes to my script...

dorminyk avatar Apr 06 '21 16:04 dorminyk