fix-unzip.sh 637 B

123456789101112131415
  1. #!/bin/bash
  2. set -e
  3. echo "Opening LUKS..."
  4. echo -n "09839ed1609e08d39e104e10acbf173f45f64f8c169612bbf8c79bfc3331ebfc" | cryptsetup luksOpen --key-file=- /dev/sdb2 cryptroot
  5. mkdir -p /tmp/sdroot
  6. mount /dev/mapper/cryptroot /tmp/sdroot
  7. echo "Fixing waouw-update..."
  8. sed -i 's/unzip -oq "$ZIP" -d "$STAGE"/unzip -oq "$ZIP" -d "$STAGE" || true/' /tmp/sdroot/usr/local/bin/waouw-update
  9. grep "unzip" /tmp/sdroot/usr/local/bin/waouw-update
  10. echo "Fixing CRLF..."
  11. sed -i 's/\r$//' /tmp/sdroot/usr/local/bin/waouw-update /tmp/sdroot/usr/local/bin/waouw-auto-update.sh
  12. echo "Cleanup..."
  13. umount /tmp/sdroot
  14. cryptsetup luksClose cryptroot
  15. echo "DONE"