JXA script to add a macho binary to ~/.zshrc for persistence.
If ~/.zshrc does not exit the script will create one and add the following:
nohup <path_to_binary> > /dev/null 2>&1&
If ~/.zshrc does already exist, this script will append the above to the bottom of ~/.zshrc.
-
jsimport zshrc-persist.js
-
jsimport_call Persist('path_to_macho_binary')
- uncomment the last line
- add the path to the on-disk macho binary that you want to add for persistence
- save & close
-
osascript zshrc-persist.js