Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/sh
downloaded_file="ddj-1000_110dmg.zip"
dmg_file="DDJ-1000_M_1.1.0.dmg"
mount_point="/Volumes/DDJ-1000-DMG"
pkg_file="DDJ-1000AudioDriver.pkg"
repack_folder="ddj-1000-repack"
new_driver="updated-ddj-1000-driver.pkg"
if [[ ! -f "${downloaded_file}" ]]; then
curl https://www.pioneerdj.com/-/media/pioneerdj/downloads/drivers/ddj-1000/ddj-1000_110dmg.zip -O "${downloaded_file}"
fi
unzip -o ${downloaded_file}
hdiutil attach "${dmg_file}" -mountpoint "${mount_point}"
cp "${mount_point}/${pkg_file}" .
rm -rf "${repack_folder}"
pkgutil --expand "${pkg_file}" "${repack_folder}"
sed -i '' 's/#!\/usr\/bin\/perl/#!\/usr\/bin\/perl5.18/' ddj-1000-repack/tmp.pkg/Scripts/postinstall
mkdir -p script_tmp_dir
rm -f "${new_driver}"
pkgutil --flatten "${repack_folder}" "${new_driver}"
hdiutil detach "${mount_point}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment