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