From 6f64fa699ecf889d72630403aa94a73845cb947f Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Fri, 12 Sep 2025 22:37:40 -0500 Subject: remove passwdgen script --- misc/passwdgen | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100755 misc/passwdgen (limited to 'misc/passwdgen') diff --git a/misc/passwdgen b/misc/passwdgen deleted file mode 100755 index 8e20ba7..0000000 --- a/misc/passwdgen +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -[ -n "`echo $1$2 | tr -d '[:digit:]'`" ] && echo "Usage: $0 [Itterations] [Length] [Character Set]" && exit -[ -z "$1" ] && itt=5 || itt=$1 -[ -z "$2" ] && len=20 || len=$2 -[ -z "$3" ] && set="[:alnum:],.<>/?\'!@#$%^&*()[]{};:-_=+" || set=$3 -genpasswd() { tr -cd "$3" < /dev/urandom | fold -w$1 | head -n$2; } -genpasswd $len $itt $set - -# Old solution using recursion which was much slower (and apparently less posix compliant) but also much cooler -## This should all work in dash (its all posix compliant shell), but there are frequent segmentation faults and formatting errors in the output. Bash fixes that all for some reason. Probably an issue of recursion depth and some other bugs or something in dash I have no idea. -#genpasswd() { pass=$pass`head -1 /dev/urandom | tr -cd '[:graph:]'` && [ `echo -n $pass | wc -m` -ge $len ] && echo $pass | cut -c -$len && pass="" || genpasswd; } -#for i in `seq $itt`; do genpasswd; done - -# Other old solution that is much faster for extremely long passwords, but slower for many shorter ones since it utilizes a for loop -#genpasswd() { tr -cd '[:graph:]' < /dev/urandom | head -c$1 && echo; } -#for i in `seq $itt`; do genpasswd $len; done -- cgit v1.2.3