diff options
author | osm0sis <osm0sis@outlook.com> | 2019-06-17 23:01:04 -0300 |
---|---|---|
committer | osm0sis <osm0sis@outlook.com> | 2019-06-17 23:01:04 -0300 |
commit | 4e403f12e50736a9c9155aebdede1912773defac (patch) | |
tree | 32c9ca14cbefb895ead0bc25c608c62ec69e6b9f | |
parent | 3685456911eb58a5d705375662e8e676df038249 (diff) |
AK3: better living through sed
- clean up magiskboot compression type output parsing
-rwxr-xr-x | tools/ak3-core.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/ak3-core.sh b/tools/ak3-core.sh index 8e05e08..ac04275 100755 --- a/tools/ak3-core.sh +++ b/tools/ak3-core.sh @@ -128,11 +128,11 @@ unpack_ramdisk() { fi; if [ -f ramdisk.cpio ]; then - comp=$($bin/magiskboot decompress ramdisk.cpio 2>&1 | head -n1 | cut -d[ -f2 | cut -d] -f1 | grep -v 'compressed'); + comp=$($bin/magiskboot decompress ramdisk.cpio 2>&1 | grep -v 'raw' | sed -n 's;.*\[\(.*\)\];\1;p'); else abort "No ramdisk found to unpack. Aborting..."; fi; - if [ "$comp" -a "$comp" != "raw" ]; then + if [ "$comp" ]; then mv -f ramdisk.cpio ramdisk.cpio.$comp; $bin/magiskboot decompress ramdisk.cpio.$comp ramdisk.cpio; if [ $? != 0 ]; then |