diff options
-rwxr-xr-x | dicewords | 2 | ||||
-rwxr-xr-x | letsencrypt-helpers/request-letsencrypt | 2 | ||||
-rwxr-xr-x | qr | 25 |
3 files changed, 21 insertions, 8 deletions
@@ -36,5 +36,5 @@ if ! [ -e "$dictionary" ]; then exit 1 fi -egrep '^[a-z]{1,6}$' "$dictionary" | shuf | head -n "$count" | tr '\n' '-' | sed -e 's/-$//' +egrep '^[a-z]{1,6}$' "$dictionary" | shuf | head -n "$count" | tr '\n' '.' | sed -e 's/\.$//' echo diff --git a/letsencrypt-helpers/request-letsencrypt b/letsencrypt-helpers/request-letsencrypt index 06bb266..f20dab0 100755 --- a/letsencrypt-helpers/request-letsencrypt +++ b/letsencrypt-helpers/request-letsencrypt @@ -43,7 +43,7 @@ tmp="`tempfile`" trap "rm -f '$tmp'" EXIT echo $PATH -acme --account-key ~/account.key --csr "$cn".csr --acme-dir ~/acme-challenge/ > "$tmp" +acme --disable-check --account-key ~/account.key --csr "$cn".csr --acme-dir ~/acme-challenge/ > "$tmp" if [ -e "$cn-letsencrypt.pem" ]; then savelog "$cn-letsencrypt.pem" fi @@ -27,18 +27,21 @@ usage() { cat << EOF usage: $0 -m <MSG> + $0 -w <essid> <password> $0 [options] [<file>] OPTIONS: -m <MSG> Use MSG instead of reading input from file/stdin. -M Add a/Include the trailing newline for single-line data. + -w <essid> <password> Create a wifi qr code. EOF } msg="" have_msg=0 multi_line=0 -while getopts "hm:M" OPTION +wifi=0 +while getopts "hm:Mw" OPTION do case $OPTION in h) @@ -52,6 +55,9 @@ do have_msg=1 msg="$OPTARG" ;; + w) + wifi=1 + ;; *) usage >&2 exit 1 @@ -61,22 +67,29 @@ done shift $(($OPTIND - 1)) -img="$(tempfile --suffix .png)" +img="$(mktemp --suffix .png)" trap "rm -f '$img'" EXIT -if [ "$have_msg" -eq 0 ]; then +if [ "$wifi" -gt 0 ]; then + if [ "$#" -ne 2 ]; then + usage >&2 + exit 1 + fi + essid="$1"; shift + password="$1"; shift + echo "WIFI:T:WPA;S:${essid};P:${password};;" | qrencode -s 5 -l H -o "$img" +elif [ "$have_msg" -eq 0 ]; then if [ "$#" -gt 1 ]; then usage >&2 exit 1 fi if [ "$#" -eq 0 ]; then - stdin="$(tempfile)" + stdin="$(mktemp)" trap "rm -f '$img' '$stdin'" EXIT cat > "$stdin" - set dummy "$stdin" - shift + set -- "$stdin" fi fn="$1"; shift |