-
Notifications
You must be signed in to change notification settings - Fork 24
/
aws-payg.sh
43 lines (35 loc) · 1021 Bytes
/
aws-payg.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
# check we are root
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
#
# be sure to first run
#
# bash build_01.sh
# bash build_02.sh
#
# switch the activation type to AWS instead of default Azure
sed -i "s/deploy=azure/deploy=aws/g" /etc/cron.hourly/websafety_license
# create aws license update service that runs exactly once
cp appliance/aws/wslicd.service /etc/systemd/system/wslicd.service
# enable it
systemctl enable wslicd.service
systemctl daemon-reload
# set new cloud license
if [ -f /home/ubuntu/license-cloud.pem ]; then
cp /home/ubuntu/license-cloud.pem /opt/websafety/etc/license.pem
chown proxy:proxy /opt/websafety/etc/license.pem
fi
# install password change aws service and prepare for AMI generation
pushd appliance/aws
bash 01_pasw.sh && bash 02_clean.sh
popd
# tell
echo "SUCCESS"
echo "SUCCESS"
echo "SUCCESS --- AWS PAYG instance is ready ---"
cat /opt/websafety/etc/license.pem | grep "Not After"
echo "SUCCESS"
echo "SUCCESS"