subscription logic changed for notify.pl
This commit is contained in:
parent
a3ced25598
commit
35bfa8a28d
2
mvvm.sh
2
mvvm.sh
|
@ -53,5 +53,5 @@ if [ -f "/var/vmm/${1}.qcow2" ]; then
|
||||||
echo -n "Size of qcow2: "
|
echo -n "Size of qcow2: "
|
||||||
ls -alh /var/vmm/${1}.qcow2 | awk '{print $5}'
|
ls -alh /var/vmm/${1}.qcow2 | awk '{print $5}'
|
||||||
echo "rsync -ve 'ssh -p 31415 -i ~mischa/.ssh/id_ed25519' --rsync-path='doas rsync' /var/vmm/${1}.qcow2 mischa@${2}.obsda.ms:/var/vmm/${3}.qcow2"
|
echo "rsync -ve 'ssh -p 31415 -i ~mischa/.ssh/id_ed25519' --rsync-path='doas rsync' /var/vmm/${1}.qcow2 mischa@${2}.obsda.ms:/var/vmm/${3}.qcow2"
|
||||||
rsync -ve 'ssh -p 31415 -i ~mischa/.ssh/id_ed25519' --rsync-path='doas rsync' /var/vmm/${1}.qcow2 mischa@${2}.obsda.ms:/var/vmm/${3}.qcow2 && pushover.pl -m "rsync ${3} done"
|
rsync -ve 'ssh -p 31415 -i ~mischa/.ssh/id_ed25519' --rsync-path='doas rsync' /var/vmm/${1}.qcow2 mischa@${2}.obsda.ms:/var/vmm/${3}.qcow2 && pushover.pl -m "rsync ${3} to ${2} done"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -175,7 +175,7 @@ if ($function =~ /notify/) {
|
||||||
if (defined $vms{$vm_name}{'subscription'} and $vms{$vm_name}{'subscription'} =~ /yes/) { delete $vms{$vm_name}; next; }
|
if (defined $vms{$vm_name}{'subscription'} and $vms{$vm_name}{'subscription'} =~ /yes/) { delete $vms{$vm_name}; next; }
|
||||||
}
|
}
|
||||||
if ($function =~ /subscription/) {
|
if ($function =~ /subscription/) {
|
||||||
if (defined $vms{$vm_name}{'subscription'} and $vms{$vm_name}{'subscription'} eq "") { delete $vms{$vm_name}; next; }
|
if (!defined $vms{$vm_name}{'subscription'} or $vms{$vm_name}{'subscription'} eq "" or $vms{$vm_name}{'subscription'} =~ /no/) { delete $vms{$vm_name}; next; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mailout(\%conf, \%vms);
|
mailout(\%conf, \%vms);
|
||||||
|
|
|
@ -34,12 +34,12 @@ if [[ ! -f "${IMAGES}/${1}.qcow2" ]]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
deploy.pl
|
/home/mischa/bin/deploy.pl
|
||||||
rcctl restart dhcpd
|
rcctl restart dhcpd
|
||||||
vmctl reload
|
vmctl reload
|
||||||
vmctl start ${1}
|
vmctl start ${1}
|
||||||
sleep 30
|
sleep 30
|
||||||
echo "SUCCES! - deployed ${1}"
|
echo "SUCCES! - deployed ${1}"
|
||||||
cp -v /home/mischa/templates/email-deployed.txt-redeploy /home/mischa/templates/email-deployed.txt
|
cp -v /home/mischa/templates/email-deployed.txt-redeploy /home/mischa/templates/email-deployed.txt
|
||||||
notify.pl deployed ${1}
|
/home/mischa/bin/notify.pl deployed ${1}
|
||||||
cp -v /home/mischa/templates/email-deployed.txt-orig /home/mischa/templates/email-deployed.txt
|
cp -v /home/mischa/templates/email-deployed.txt-orig /home/mischa/templates/email-deployed.txt
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
mac="fe:e1:ab:dd:73:a4"
|
mac="fe:e1:ab:dd:73:a4"
|
||||||
ip="192.168.1.1"
|
ip="192.168.1.1"
|
||||||
owner="testuser1"
|
owner="testuser1"
|
||||||
date="2018/05/02"
|
date="2018/07/02"
|
||||||
payment="70"
|
payment="70"
|
||||||
donated=""
|
donated=""
|
||||||
name="Test1 User"
|
name="Test1 User"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
date="2018/02/02"
|
date="2018/07/02"
|
||||||
payment="70"
|
payment="70"
|
||||||
subscription=""
|
subscription=""
|
||||||
donated=""
|
donated=""
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
date="2020/02/21"
|
date="2020/07/21"
|
||||||
payment="60"
|
payment="60"
|
||||||
subscription="yes"
|
subscription="yes"
|
||||||
donated=""
|
donated=""
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
date="2020/07/21"
|
||||||
|
payment="60"
|
||||||
|
subscription="no"
|
||||||
|
donated=""
|
||||||
|
name="Test3"
|
||||||
|
email="vm03@high5.nl"
|
||||||
|
sshkey="ssh-ed25519 AAAAC3NzDI1NTE5AaaaIK7lMIQ4L4GcOyclKj9WLQPnHrGuP5ExjxZVmvLn"
|
||||||
|
hostname="deploytest3"
|
||||||
|
username="deploytest3"
|
||||||
|
note="here be dragons!"
|
||||||
|
memory="512M"
|
||||||
|
disk2=""
|
||||||
|
format="qcow2"
|
||||||
|
referral=""
|
Loading…
Reference in New Issue