Update vmcreate1.sh
This commit is contained in:
14
vmcreate1.sh
14
vmcreate1.sh
@@ -24,10 +24,11 @@ show_help(){
|
|||||||
echo "-p - specify password instead of default"
|
echo "-p - specify password instead of default"
|
||||||
echo "-d - add custom disk space (in gibibytes, integer). Default is 50."
|
echo "-d - add custom disk space (in gibibytes, integer). Default is 50."
|
||||||
echo "-t - add additional proxmox tag. Default is only pve node number."
|
echo "-t - add additional proxmox tag. Default is only pve node number."
|
||||||
echo "-f - get IP addresses and Hostnames from 'flilename';"
|
echo "-f - get IP addresses and Hostnames from 'flilename'"
|
||||||
echo "\nIf file not specified, script will use arguments as a list of IP addresses."
|
echo
|
||||||
|
echo "If file not specified, script will use arguments as a list of IP addresses."
|
||||||
echo "In this case Hostname will be inherited from 2 last IP octets. Example for 10.10.35.20: 'vm035020'."
|
echo "In this case Hostname will be inherited from 2 last IP octets. Example for 10.10.35.20: 'vm035020'."
|
||||||
echo "IP address should be 10.10.*.*"
|
echo "IP address should be 10.10.XXX.YYY"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Обрабатываем опции
|
# Обрабатываем опции
|
||||||
@@ -173,8 +174,8 @@ if [ -v pubkey ]; then
|
|||||||
case $input in
|
case $input in
|
||||||
y) read -p "Enter name for your private key: " privkey && keypair_generate "$privkey";;
|
y) read -p "Enter name for your private key: " privkey && keypair_generate "$privkey";;
|
||||||
Y) read -p "Enter name for your private key: " privkey && keypair_generate "$privkey";;
|
Y) read -p "Enter name for your private key: " privkey && keypair_generate "$privkey";;
|
||||||
n) echo "Public key is necessary to continue. Please specify or generate new pair.";;
|
n) echo "Public key is necessary to continue. Please specify or generate new pair."; exit 6;;
|
||||||
N) echo "Public key is necessary to continue. Please specify or generate new pair.";;
|
N) echo "Public key is necessary to continue. Please specify or generate new pair."; exit 6;;
|
||||||
*) echo "Use '-h' flag for help"; exit 6;;
|
*) echo "Use '-h' flag for help"; exit 6;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
@@ -258,6 +259,7 @@ done
|
|||||||
rm hosts.tmp
|
rm hosts.tmp
|
||||||
if [ -v $privkey ]
|
if [ -v $privkey ]
|
||||||
then
|
then
|
||||||
echo "\nGenerated private key: ./$privkey"
|
echo
|
||||||
|
echo "Generated private key: ./$privkey"
|
||||||
echo "SAVE IT IMMEDIATELY!!!"
|
echo "SAVE IT IMMEDIATELY!!!"
|
||||||
fi
|
fi
|
||||||
Reference in New Issue
Block a user