pack_binary.sh 734 B

123456789101112131415161718
  1. #!/bin/sh
  2. # Simple script to produce a self-extracting packed binary
  3. export packed_binary=eliasdb_packed
  4. echo "cat \$0 | sed '1,/#### Binary ####/d' | gzip -d > ./__e" > $packed_binary
  5. echo "chmod ugo+x ./__e" >> $packed_binary
  6. echo "mv ./__e ./\$0" >> $packed_binary
  7. echo "./\$0" >> $packed_binary
  8. echo "exit 0" >> $packed_binary
  9. echo "This is a simple shell script trying to unpack the binary data" >> $packed_binary
  10. echo "after the marker below. Unpack manually by deleting all lines" >> $packed_binary
  11. echo "up to and including the marker line and do a gzip -d on the" >> $packed_binary
  12. echo "binary data" >> $packed_binary
  13. echo "#### Binary ####" >> $packed_binary
  14. gzip -c eliasdb >> $packed_binary
  15. chmod ugo+x $packed_binary