dot

packages and services management
Log | Files | Refs | README

commit adad94f7914c7a353e53cd16ba78c6dcfbbef410
parent 99a1543624400378619dbc8b9534dd3a535fee95
Author: Josuah Demangeon <mail@josuah.net>
Date:   Wed, 29 Nov 2017 10:26:19 +0100

getting started with certificates

Diffstat:
Mbin/etc | 3---
Mbin/tls | 11++++++++---
2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/bin/etc b/bin/etc @@ -1,8 +1,6 @@ #!/bin/sh ETC=$(cd "${0%/*}/.." && pwd) -set -x - case $1 in (dot) cd "$ETC/dot" || exit 1 @@ -33,7 +31,6 @@ case $1 in git clone josuah@git.josuah.net:srv/git/notes.git ;; (setup) - echo 'test' mkdir -p "$HOME/.config" [ -f "$ETC/cron/$2" ] && cat "$ETC/cron/$2" >> "$HOME/.config/cron" [ -f "$ETC/inet/$2" ] && cat "$ETC/inet/$2" >> "$HOME/.config/inet" diff --git a/bin/tls b/bin/tls @@ -1,11 +1,16 @@ #!/bin/sh case $1 in -(generate) - openssl genpkey -algorithm RSA -out private_key.pem \ +(update) + set -e + openssl genpkey -algorithm RSA -out "$2.key" \ -pkeyopt rsa_keygen_bits:2048 + chmod 400 "$2.key" + openssl openssl rsa -pubout -in "$2.key" -out "$2.pem" + chmod 444 "$2.pem" + openssl rsa -text -in "$2.key" ;; (*) - printf 'usage: tls [generate]\n' + printf 'usage: tls [update path]\n' ;; esac