mirror of
https://github.com/bashclub/proxmox-zfs-postinstall.git
synced 2024-12-25 17:50:13 +01:00
Update proxmox-zfs-postinstall.sh, fix if queries
This commit is contained in:
parent
4105a6b2d3
commit
31be2d6e2a
@ -99,19 +99,19 @@ fi
|
||||
echo -e "######## Configure Swapfile ########\n"
|
||||
|
||||
read -p "With the default PVE-root on ZFS installation, no swap is created. Do you want to create a swapfile/zfs swap volume dataset? (y/n)" swapfile_userinput_bool
|
||||
if [ $swapfile_userinput_bool -eq "y" ]; then
|
||||
if [ $swapfile_userinput_bool == "y" ]; then
|
||||
read -p "Name for the swap dataset? Leave empty to use default 'swap'" swapfile_userinput_name
|
||||
if [ x$swapfile_userinput_name -eq "x" ]; then
|
||||
swapfile_name = "swap";
|
||||
if [ x$swapfile_userinput_name == "x" ]; then
|
||||
swapfile_name="swap";
|
||||
else
|
||||
swapfile_name = $swapfile_userinput_name;
|
||||
swapfile_name=$swapfile_userinput_name;
|
||||
fi
|
||||
read -p "Size for the swap volume in G, only numbers" swapfile_userinput_size
|
||||
if echo "$swapfile_userinput_size" | grep -qE '^[0-9]+$'; then
|
||||
swapfile_size = $swapfile_userinput_size;
|
||||
swapfile_size=$swapfile_userinput_size;
|
||||
else
|
||||
echo "No valid input detected, falling back to 20G Swap Size";
|
||||
swapfile_size = "20";
|
||||
swapfile_size="20";
|
||||
fi
|
||||
else
|
||||
echo "No swapfile will be created"
|
||||
|
Loading…
Reference in New Issue
Block a user