Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/bash
- if [ $# -eq 0 ] || [ $# -gt 1 ]; then
- echo "Exactly ONE argument needed"
- else
- filename=$1
- extension="${filename##*.}"
- filename="${filename%.*}"
- if [ "$extension" == "enc" ]; then
- openssl enc -d -aes-256-cbc -in $1 -out $filename
- else
- echo "Extension should be .enc, decrypting anyway"
- openssl enc -d -aes-256-cbc -in $1 -out $1.dec
- fi
- fi
Add Comment
Please, Sign In to add comment