From 15f41c1af833148d5f4a08d3b63e4f0345ce939a Mon Sep 17 00:00:00 2001 From: navewindre Date: Wed, 18 Jun 2025 05:24:46 +0200 Subject: user check --- slackware-bootstrap/bootstrap | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/slackware-bootstrap/bootstrap b/slackware-bootstrap/bootstrap index d628cd6..4ff4dd2 100755 --- a/slackware-bootstrap/bootstrap +++ b/slackware-bootstrap/bootstrap @@ -3,14 +3,24 @@ basedir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) username="user" kernelver="6.15.2" +hasuser=0 while getopts u:a:f: flag do case "${flag}" in - u) username=${OPTARG};; + u) username=${OPTARG} + hasuser=1 + ;; esac done +if [[ $hasuser == 0 ]]; then + read -p "WARNING: username not provided. continue? [y/n] (n):" choice + if [[ $choice != "y" ]]; then + exit 1 + fi +fi + echo "working dir: $basedir" sh $basedir/user $username -- cgit v1.2.3