You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.1 KiB
Bash

#!/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