Installation script enchansements
parent
e31c7ae8cd
commit
30171b8d5a
|
@ -11,10 +11,10 @@
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
User = "restic";
|
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 = ''
|
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
|
# Create records
|
||||||
CreateARecord()
|
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 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" 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()
|
PerformTests()
|
||||||
|
@ -321,9 +329,11 @@ then
|
||||||
exit -1
|
exit -1
|
||||||
fi
|
fi
|
||||||
printf "Purging records..."
|
printf "Purging records..."
|
||||||
|
GetZoneID
|
||||||
PurgeDNSRecords
|
PurgeDNSRecords
|
||||||
printf "done"
|
printf "done"
|
||||||
CreateARecord
|
CreateARecord
|
||||||
|
WaitDNSPropagation
|
||||||
ApplyConfig
|
ApplyConfig
|
||||||
if [ $RESTORE_MAILBACKUP == "y" ]
|
if [ $RESTORE_MAILBACKUP == "y" ]
|
||||||
then
|
then
|
||||||
|
|
Loading…
Reference in New Issue