Installation script enchansements
parent
e31c7ae8cd
commit
30171b8d5a
|
@ -11,10 +11,10 @@
|
|||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
User = "restic";
|
||||
Environment = [ "AWS_ACCESS_KEY_ID=AKIAJOVDNQ6FERMIDHKA" "AWS_SECRET_ACCESS_KEY=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" ];
|
||||
Environment = [ "AWS_ACCESS_KEY_ID=" "AWS_SECRET_ACCESS_KEY=" ];
|
||||
};
|
||||
script = ''
|
||||
restic -r s3:s3.amazonaws.com/haep9c-backup backup /var/vmail /var/vmail
|
||||
restic -r s3:s3.amazonaws.com/ backup /var/vmail /var/vmail
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
|
@ -218,6 +218,16 @@ done
|
|||
|
||||
}
|
||||
|
||||
WaitDNSPropagation()
|
||||
{
|
||||
printf "Waiting for DNS Record to propagate..."
|
||||
while [[ $( dig A +short ilchub.net ) != $machineip ]]
|
||||
do
|
||||
sleep 1
|
||||
done
|
||||
printf "done"
|
||||
}
|
||||
|
||||
# Create records
|
||||
CreateARecord()
|
||||
{
|
||||
|
@ -262,8 +272,6 @@ PostInstallation()
|
|||
{
|
||||
ssh -i ~/.nix-ms/id_rsa "root@$machineip" restic -r s3:s3.amazonaws.com/$AWS_BUCKET_NAME init
|
||||
ssh -i ~/.nix-ms/id_rsa "root@$machineip" restic -r s3:s3.amazonaws.com/$AWS_BUCKET_NAME forget --prune --keep-hourly 2 --keep-daily 7 --keep-weekly 4
|
||||
#ssh -i ~/.nix-ms/id_rsa "root@$machineip" cp /root/result/bin/goss /root/
|
||||
#ssh -i ~/.nix-ms/id_rsa "root@$machineip" /root/goss serve --format json &
|
||||
}
|
||||
|
||||
PerformTests()
|
||||
|
@ -321,9 +329,11 @@ then
|
|||
exit -1
|
||||
fi
|
||||
printf "Purging records..."
|
||||
GetZoneID
|
||||
PurgeDNSRecords
|
||||
printf "done"
|
||||
CreateARecord
|
||||
WaitDNSPropagation
|
||||
ApplyConfig
|
||||
if [ $RESTORE_MAILBACKUP == "y" ]
|
||||
then
|
||||
|
|
Loading…
Reference in New Issue