compress_binary.sh 794 B

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