Browse Source

script bash

master
fanta 5 months ago
parent
commit
1aa8ca54d8
1 changed files with 42 additions and 0 deletions
  1. +42
    -0
      doom2bin.sh

+ 42
- 0
doom2bin.sh View File

@@ -0,0 +1,42 @@
#!/bin/bash
urlDoom="https://distro.ibiblio.org/slitaz/sources/packages/d/doom1.wad"

main(){
downloadDoom
compressDoom
encode2Base64Doom
encode2BinaryDoom
}

downloadDoom(){
echo "[+] Downloading doom1.wad . Please wait."
wget -q -nc -O doom1.wad "$urlDoom"
echo " doom1.wad size: $(stat -c %s doom1.wad)"
}

compressDoom(){
echo "[+] Compressing doom1.wad.tar.xz . Please wait."
tar cfJ doom1.wad.tar.xz doom1.wad
echo " doom1.wad.tar.xz size: $(stat -c %s doom1.wad.tar.xz)"
}

encode2Base64Doom(){
echo "[+] Encoding to base64 doom1.wad.tar.xz.b64 . Please wait."
base64 doom1.wad.tar.xz > doom1.wad.tar.xz.b64
echo " doom1.wad.tar.xz.b64 size: $(stat -c %s doom1.wad.tar.xz.b64)"
}

encode2BinaryDoom(){
echo "[+] Encoding to binary doom1.wad.tar.xz.b64.bin . Please wait."
> doom1.wad.tar.xz.b64.bin
sleep 2
while read line
do
echo $line | xxd -b -g 100 -c 100 | cut -d " " -f 2 | tee -a doom1.wad.tar.xz.b64.bin
done < doom1.wad.tar.xz.b64
echo " doom1.wad.tar.xz.b64.bin size: $(stat -c %s doom1.wad.tar.xz.b64.bin)"

}


main

Loading…
Cancel
Save