#!/bin/bash cd $1/payload if ! $4; then echo "Adding files:" ls lib/app -1A echo "" fi tar cf ../payload.tar ./* cd .. if [ -e "payload.tar" ]; then gzip payload.tar if [ -e "payload.tar.gz" ]; then sed -i -e "s/__RUBY_COMMAND__/$2/g" decompress cat decompress payload.tar.gz > output else echo "payload.tar.gz does not exist" exit 1 fi else echo "payload.tar does not exist" exit 1 fi chmod +x output echo "SUCCESS! (filename is \"$3\")" exit 0