Skip to content

Instantly share code, notes, and snippets.

@arpanetus
Last active June 21, 2022 11:29
Show Gist options
  • Save arpanetus/8b4c02a8abcf5a66f64e28bfd5662751 to your computer and use it in GitHub Desktop.
Save arpanetus/8b4c02a8abcf5a66f64e28bfd5662751 to your computer and use it in GitHub Desktop.
nca.sh
#!/bin/bash
cd ~/Downloads
if [ -f "ncalayer.zip" ]; then
while true; do
read -p "file exists, you want to download it again? (y/n): " yn
case $yn in
[yY] ) echo "downloading it";
mv ncalayer.zip ncalayer.old.zip
wget https://ncl.pki.gov.kz/images/NCALayer/ncalayer.zip ncalayer.zip;
break;;
[nN] ) echo "ok, proceeding";
break;;
* ) echo "invalid response";;
esac;
done;
else
echo "downloading it"
wget https://ncl.pki.gov.kz/images/NCALayer/ncalayer.zip
fi;
echo "copying from ~/Downloads into /tmp"
cp ~/Downloads/ncalayer.zip /tmp
echo "changing directory to /tmp"
cd /tmp
echo "unzipping"
unzip ncalayer.zip
echo "creating the install directory"
mkdir -p /tmp/NCALayer
echo "running the script"
/tmp/ncalayer.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment