Update vmcreate1.sh

This commit is contained in:
2025-10-26 17:15:17 +00:00
parent 61f866c255
commit a11b285216

View File

@@ -94,7 +94,7 @@ mksnippet (){
phash=$(cat $password | mkpasswd -m sha-256 -s)
sed -i "s|.*password.*| - ${phash}|" "$snippet"
fi
sed -i "s|.*ssh-rsa.*| - ${pubkey}|" "$snippet"
sed -i "s|.*ssh-rsa.*| - (cat ${pubkey})|" "$snippet"
echo "Snippet $snippet created"
}
@@ -159,6 +159,7 @@ if [[ $# -eq 0 && -e "$file" ]]; then
echo "DEBUG line:$line"
ip=$(echo -n $line | cut -d ';' -f 1)
hostname=$(echo -n $line | cut -d ';' -f 2)
ipcheck "$ip"
if [[ $? -eq 0 ]]; then
hostcheck "$hostname"
if [[ $? -eq 0 ]]; then