Skip to content

Instantly share code, notes, and snippets.

@alex4u2nv
Last active January 19, 2021 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alex4u2nv/376424cc066510aa27e016dead8ab624 to your computer and use it in GitHub Desktop.
Save alex4u2nv/376424cc066510aa27e016dead8ab624 to your computer and use it in GitHub Desktop.
#!/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