summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/encsh20
1 files changed, 20 insertions, 0 deletions
diff --git a/bin/encsh b/bin/encsh
new file mode 100755
index 0000000..9888e0f
--- /dev/null
+++ b/bin/encsh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+[ "$1" ] && {
+ echo 'encsh creates a password protected encrypted shell script.
+Usage: encsh <script >script-enc
+ chmod +x script-enc
+ script-enc [--show|args...]'
+ exit
+}
+
+echo '#!/bin/sh
+s=$(openssl aes-256-cbc -a -d -salt -pbkdf2 << \EOT'
+
+openssl aes-256-cbc -a -salt -pbkdf2
+
+echo 'EOT
+)
+[ "$1" == --show ] && echo "$s" && exit
+eval "$s $@"
+'