-
Notifications
You must be signed in to change notification settings - Fork 0
/
1_BaseSetup_SYS
executable file
·59 lines (34 loc) · 1.24 KB
/
1_BaseSetup_SYS
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
# ------------------- install vars
HOSTNAME=$1
# ------------------- make base snapshot
hostnamectl hostname ${HOSTNAME}
# ------------------- setup NTP
mkdir /etc/systemd/timesyncd.conf.d/
dd of=/etc/systemd/timesyncd.conf.d/servers.conf << EOF
[Time]
NTP=hora.roa.es 0.es.pool.ntp.org 1.es.pool.ntp.org 2.es.pool.ntp.org 3.es.pool.ntp.org
FallbackNTP=0.arch.pool.ntp.org 1.arch.pool.ntp.org 2.arch.pool.ntp.org 3.arch.pool.ntp.org
EOF
timedatectl set-timezone Europe/Madrid
systemctl restart systemd-timesyncd.service
sleep 3
timedatectl set-ntp true
timedatectl show-timesync --all
# ------------------- make base snapshot
# make a instant
# https://www.dwarmstrong.org/btrfs-snapshots-rollbacks/
umount /.snapshots
rm -rf /.snapshots
snapper -c root create-config /
snapper -c home create-config /home
btrfs subvolume delete /.snapshots
mkdir /.snapshots
mount -a
chmod 750 /.snapshots
chown :wheel /.snapshots
sed -i 's/ALLOW_GROUPS=""/ALLOW_GROUPS="wheel"/' /etc/snapper/configs/root
sed -i 's/ALLOW_GROUPS=""/ALLOW_GROUPS="wheel"/' /etc/snapper/configs/home
# ------------------------------------------------- snapper checkpoint
snapper -c root create -d "Base setup: System"
snapper -c home create -d "Base setup: System"