-
Notifications
You must be signed in to change notification settings - Fork 0
/
10-init.sh
29 lines (21 loc) · 824 Bytes
/
10-init.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
#!/bin/bash
source shared.sh
request_confirmation "Update packages" && \
DEBIAN_FRONTEND=noninteractive sudo apt-get update -y > /dev/null && \
DEBIAN_FRONTEND=noninteractive sudo apt-get upgrade -y > /dev/null
echo
install_packages curl openssl ca-certificates
echo
if install_packages ntp; then
backup_file /etc/ntpsec/ntp.conf && \
echo "Editing ntp configuration"
sudo sed -i -r -e "s/^((server|pool).*)/# \1$(commented_by)/" /etc/ntpsec/ntp.conf > /dev/null && \
echo -e "\npool pool.ntp.org iburst$(added_by)" | sudo tee -a /etc/ntpsec/ntp.conf > /dev/null
restart_service ntp
fi
echo
if install_packages rng-tools; then
echo "Editing rng-tools configuration"
echo "HRNGDEVICE=/dev/urandom$(added_by)" | sudo tee -a /etc/default/rng-tools > /dev/null
restart_service rng-tools
fi