dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles # fast
git clone https://src.adamsgaard.dk/dotfiles.git # slow
Log | Files | Refs | README | LICENSE Back to index

enc (332B)


      1 #!/bin/sh
      2 set -e
      3 
      4 handle_file()
      5 {
      6 	if [ "$unencrypt" = 1 ]; then
      7 		openssl aes-256-cbc -d -a -iter 100000 -in "$1" -out "${1%.enc}"
      8 		rm "$f"
      9 	else
     10 		openssl aes-256-cbc -a -iter 100000 -in "$1" -out "${1}.enc"
     11 		rm -P "$f"
     12 	fi
     13 }
     14 
     15 unencrypt=0
     16 if [ "$1" = "-u" ]; then
     17 	unencrypt=1
     18 	shift
     19 fi
     20 for f in "$@"; do
     21 	handle_file "$f"
     22 done