param="$1"
default="$2"
shift 2
- read -rep "$* (defaults to $default): " input
+
+ if echo $param | grep -q 'passwd'; then
+ read -s -rep "$* (defaults to $default): " input
+ else
+ read -rep "$* (defaults to $default): " input
+ fi
if [ -z "$input" ]; then
- export $param=$default
+ export $param="$default"
else
- export $param=$input
+ export $param="$input"
fi
}
exit 1
fi
}
+
+# Check for an user
+function hydra_check_user {
+ if [ -z "$1" ]; then
+ return 1
+ fi
+
+ grep -qe "^$1:" /etc/passwd
+}