daily pastebin goal
1%
SHARE
TWEET

Untitled

a guest Jan 20th, 2018 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #! /bin/bash
  2.  
  3. if [ $# -eq 0 ] || [ $# -gt 1 ]; then
  4.     echo "Exactly ONE argument needed"
  5. else
  6.     filename=$1
  7.     extension="${filename##*.}"
  8.     filename="${filename%.*}"
  9.     if [ "$extension" == "enc" ]; then
  10.         openssl enc -d -aes-256-cbc -in $1 -out $filename
  11.     else
  12.         echo "Extension should be .enc, decrypting anyway"
  13.         openssl enc -d -aes-256-cbc -in $1 -out $1.dec
  14.     fi
  15. fi
RAW Paste Data
Top