-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathva.sh
More file actions
39 lines (30 loc) · 815 Bytes
/
va.sh
File metadata and controls
39 lines (30 loc) · 815 Bytes
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
#!/bin/bash
# check we are root
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
# install va scripts
pushd appliance/va
bash 01_login.sh && bash 02_harden.sh
popd
# see if we have a new license to install
if [ -f license.pem ]; then
# copy the license key
cp license.pem /opt/websafety/etc/license.pem
# and change owner to proxy user
chown proxy:proxy /opt/websafety/etc/license.pem
fi
# change working dir into root
cd /root
# remove the build user completely
deluser --remove-home builder
# tell
echo "SUCCESS"
echo "SUCCESS"
echo "SUCCESS --- Virtual Appliance is ready, do NOT REBOOT ANY MORE, just export as VA --"
cat /opt/websafety/etc/license.pem | grep "Not After"
echo "SUCCESS"
echo "SUCCESS"
# and shutdown
cd /root && shutdown -h now