++viirb cleanup
This commit is contained in:
parent
d54b383e44
commit
c803679610
2 changed files with 16 additions and 4 deletions
|
@ -5,9 +5,23 @@
|
||||||
set -e
|
set -e
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
|
if [ $# -ne 2 ]; then
|
||||||
|
echo "$0 viirb-ip-address viirb-id"
|
||||||
|
echo " viirb-ip-address: where to find the viirb"
|
||||||
|
echo " viirb-id: number in decimal format"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
viirb_ip=$1; shift
|
viirb_ip=$1; shift
|
||||||
|
|
||||||
|
id=$1; shift
|
||||||
|
viirb_hostname=viirb${id}
|
||||||
|
|
||||||
root_password=$(pwgen -1 32)
|
root_password=$(pwgen -1 32)
|
||||||
|
|
||||||
|
# Save for sending to user
|
||||||
|
# FIXME: future make this more easy / better to transfer
|
||||||
|
echo $root_password > ${viirb_hostname}.rootpw
|
||||||
|
|
||||||
cat <<EOF | ssh -t "root@${viirb_ip}"
|
cat <<EOF | ssh -t "root@${viirb_ip}"
|
||||||
# Remove temporary IP
|
# Remove temporary IP
|
||||||
|
@ -25,5 +39,3 @@ printf "${root_password}\n${root_password}\n" | passwd
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
echo "Submit to user the root password = ${root_password}"
|
echo "Submit to user the root password = ${root_password}"
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ public_key=$1; shift
|
||||||
dot_cdist=$1; shift
|
dot_cdist=$1; shift
|
||||||
|
|
||||||
hex_id=$(printf "%0.2x\n" "$id")
|
hex_id=$(printf "%0.2x\n" "$id")
|
||||||
viirb_hostname=viirb${hex_id}
|
viirb_hostname=viirb${id}
|
||||||
|
|
||||||
prefix_base=2a0a:e5c1:3
|
prefix_base=2a0a:e5c1:3
|
||||||
my_prefix=${prefix_base}${hex_id}
|
my_prefix=${prefix_base}${hex_id}
|
||||||
|
|
Loading…
Reference in a new issue