|
|
@ -6,11 +6,17 @@ do case $opt in
|
|
|
|
n) NAME=${OPTARG} ;;
|
|
|
|
n) NAME=${OPTARG} ;;
|
|
|
|
d) DEV=${OPTARG} ;;
|
|
|
|
d) DEV=${OPTARG} ;;
|
|
|
|
e) ENC=${OPTARG} ;;
|
|
|
|
e) ENC=${OPTARG} ;;
|
|
|
|
|
|
|
|
s) SWAP_SIZE=${OPTARG} ;;
|
|
|
|
\?) echo "-$OPTARG is not valid" >&2 && exit ;;
|
|
|
|
\?) echo "-$OPTARG is not valid" >&2 && exit ;;
|
|
|
|
esac
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
init() {
|
|
|
|
init() {
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
echo "+---------------------------+"
|
|
|
|
|
|
|
|
echo "| Just Some Short Questions |"
|
|
|
|
|
|
|
|
echo "+---------------------------+"
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
[ -z "$NAME" ] && read -p "Hostname: " NAME
|
|
|
|
[ -z "$NAME" ] && read -p "Hostname: " NAME
|
|
|
|
while [ -z "$PASSWD" ] || [ ! "$PASSWD" = "$CHECK" ]; do
|
|
|
|
while [ -z "$PASSWD" ] || [ ! "$PASSWD" = "$CHECK" ]; do
|
|
|
|
read -sp "Root password: " PASSWD
|
|
|
|
read -sp "Root password: " PASSWD
|
|
|
@ -21,6 +27,7 @@ init() {
|
|
|
|
[ -z "$DEV" ] && lsblk -nrpo "name,size,model" && read -p "Provide installation medium (e.g. sda, nvme0n1): " DEV
|
|
|
|
[ -z "$DEV" ] && lsblk -nrpo "name,size,model" && read -p "Provide installation medium (e.g. sda, nvme0n1): " DEV
|
|
|
|
[[ "$DEV" =~ sd[a-z] ]] && SUF="1-3" && MODE="SATA"
|
|
|
|
[[ "$DEV" =~ sd[a-z] ]] && SUF="1-3" && MODE="SATA"
|
|
|
|
[[ "$DEV" =~ nvme[0-9]n[0-9] ]] && SUF="p1-3" && MODE="NVME"
|
|
|
|
[[ "$DEV" =~ nvme[0-9]n[0-9] ]] && SUF="p1-3" && MODE="NVME"
|
|
|
|
|
|
|
|
[ -z "$SWAP_SIZE" ] && read -p "Specify the size for the SWAP partition (16G, 1M, ...): " SWAP_SIZE
|
|
|
|
[ -z "$ENC" ] && read -p "Do you want the root partition to be encrypted (y/n)? " ENC
|
|
|
|
[ -z "$ENC" ] && read -p "Do you want the root partition to be encrypted (y/n)? " ENC
|
|
|
|
[ "$ENC" == "y" ] && ENC=true || ENC=false
|
|
|
|
[ "$ENC" == "y" ] && ENC=true || ENC=false
|
|
|
|
|
|
|
|
|
|
|
@ -30,6 +37,7 @@ init() {
|
|
|
|
echo "HOSTNAME = $NAME"
|
|
|
|
echo "HOSTNAME = $NAME"
|
|
|
|
echo "ROOTPASSWD = ${PASSWD:0:1}***${PASSWD: -1}"
|
|
|
|
echo "ROOTPASSWD = ${PASSWD:0:1}***${PASSWD: -1}"
|
|
|
|
echo "DEVICEPARTS = $DEV$SUF"
|
|
|
|
echo "DEVICEPARTS = $DEV$SUF"
|
|
|
|
|
|
|
|
echo "SWAP_SIZE = $SWAP_SIZE"
|
|
|
|
echo "ENCRYPTION = $ENC"
|
|
|
|
echo "ENCRYPTION = $ENC"
|
|
|
|
read -p "Do you want to continue with these values (y/n)? " cont
|
|
|
|
read -p "Do you want to continue with these values (y/n)? " cont
|
|
|
|
[ ! "$cont" = "y" ] && unset NAME PASSWD DEV ENC && init
|
|
|
|
[ ! "$cont" = "y" ] && unset NAME PASSWD DEV ENC && init
|
|
|
@ -70,7 +78,7 @@ ef00
|
|
|
|
n
|
|
|
|
n
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+16G
|
|
|
|
+${SWAP_SIZE}
|
|
|
|
8200
|
|
|
|
8200
|
|
|
|
n
|
|
|
|
n
|
|
|
|
|
|
|
|
|
|
|
|