script bash
parent
4ca9472cf1
commit
1aa8ca54d8
@ -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…
Reference in New Issue