Created
September 25, 2012 12:34
-
-
Save caspian311/3781503 to your computer and use it in GitHub Desktop.
self-extracting shell script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -ex | |
tar zcvf app.tgz ./app | |
cp installer-script-only.sh installer.sh | |
cat app.tgz >> installer.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
TEMP_DIR=/tmp/my_app | |
mkdir -p ${TEMP_DIR} | |
CUTLINE=`grep -an "END OF SCRIPT" $0 | grep -v grep | cut -d ":" -f 1` | |
let "CUTLINE+=1" | |
tail -n +$CUTLINE $0 > ${TEMP_DIR}/my_app.tgz | |
pushd ${TEMP_DIR} | |
tar -zxf ${TEMP_DIR}/my_app.tgz | |
pushd app | |
python app.py | |
popd | |
popd | |
rm -fR ${TMP_DIR} | |
exit 0 | |
#------ END OF SCRIPT -------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment