Updated some libs
This commit is contained in:
parent
2c6036d35a
commit
4cff3cbaad
@ -3,8 +3,10 @@
|
|||||||
encpasswd() {
|
encpasswd() {
|
||||||
local password_clear=$1
|
local password_clear=$1
|
||||||
local password_md5hash=$(openssl passwd -1 $password_clear)
|
local password_md5hash=$(openssl passwd -1 $password_clear)
|
||||||
|
local password_sha1=$(echo -n $password_clear | openssl dgst -sha1)
|
||||||
echo "Password : $password_clear"
|
echo "Password : $password_clear"
|
||||||
echo "MD5HASH : $password_md5hash"
|
echo "MD5HASH : $password_md5hash"
|
||||||
|
echo "SHA1 : $password_sha1"
|
||||||
}
|
}
|
||||||
|
|
||||||
genpasswd() {
|
genpasswd() {
|
||||||
@ -12,6 +14,8 @@ genpasswd() {
|
|||||||
[ "$l" == "" ] && l=12
|
[ "$l" == "" ] && l=12
|
||||||
local password_clear=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${l} | xargs)
|
local password_clear=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${l} | xargs)
|
||||||
local password_md5hash=$(openssl passwd -1 $password_clear)
|
local password_md5hash=$(openssl passwd -1 $password_clear)
|
||||||
|
local password_sha1=$(echo -n $password_clear | openssl dgst -sha1)
|
||||||
echo "Password : $password_clear"
|
echo "Password : $password_clear"
|
||||||
echo "MD5HASH : $password_md5hash"
|
echo "MD5HASH : $password_md5hash"
|
||||||
|
echo "SHA1 : $password_sha1"
|
||||||
}
|
}
|
||||||
|
@ -104,15 +104,16 @@ vm_connect() {
|
|||||||
#### A tester
|
#### A tester
|
||||||
vm_change_bridge() {
|
vm_change_bridge() {
|
||||||
|
|
||||||
if [ $# -ne 2 ]; then echo "Usage : $0 hypervisor_name_or_ip vm_name vm_mac vm_new_bridge"; return 1; fi
|
if [ $# -ne 4 ]; then echo "Usage : $0 hypervisor_name_or_ip vm_name vm_mac vm_new_bridge"; return 1; fi
|
||||||
hypervisor=${1}
|
hypervisor=${1}
|
||||||
name=${2}
|
name=${2}
|
||||||
mac=${3}
|
mac=${3}
|
||||||
bridge=${4}
|
bridge=${4}
|
||||||
|
|
||||||
#domiflist ${name}
|
virsh --connect=qemu+ssh://${USER}@${hypervisor}/system domiflist ${name}
|
||||||
#detach-interface --config --domain ${name} --type bridge --mac ${mac}
|
virsh --connect=qemu+ssh://${USER}@${hypervisor}/system detach-interface --config --domain ${name} --type bridge --mac ${mac}
|
||||||
#attach-interface --config --domain ${name} --type bridge --mac ${mac} --source ${bridge}
|
virsh --connect=qemu+ssh://${USER}@${hypervisor}/system attach-interface --config --domain ${name} --type bridge --mac ${mac} --source ${bridge}
|
||||||
|
virsh --connect=qemu+ssh://${USER}@${hypervisor}/system domiflist ${name}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -150,3 +151,4 @@ complete -W "$(_hypervisors)" vm_create
|
|||||||
complete -W "$(_hypervisors)" vm_start
|
complete -W "$(_hypervisors)" vm_start
|
||||||
complete -W "$(_hypervisors)" vm_stop
|
complete -W "$(_hypervisors)" vm_stop
|
||||||
complete -W "$(_hypervisors)" vm_connect
|
complete -W "$(_hypervisors)" vm_connect
|
||||||
|
complete -W "$(_hypervisors)" vm_change_bridge
|
||||||
|
Loading…
Reference in New Issue
Block a user