-
Notifications
You must be signed in to change notification settings - Fork 1
/
sync.sh
executable file
·67 lines (51 loc) · 1.58 KB
/
sync.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
sync_or_copy() {
local src_path=$1
local dest_path=$2
if [ -d "$src_path" ]; then
rsync -a --delete "$src_path/" "$dest_path/"
elif [ -f "$src_path" ]; then
cp "$src_path" "$dest_path"
else
rm -rf "$dest_path"
fi
}
# Portage
PACKAGE_FILES=(
make.conf
package.use
package.accept_keywords
package.mask
package.unmask
package.license
)
for f in "${PACKAGE_FILES[@]}"; do
sync_or_copy "/etc/portage/$f" "$(pwd)/etc/portage/$f"
done
sync_or_copy /etc/eselect/repository.conf "$(pwd)/etc/eselect/repository.conf"
sync_or_copy /etc/portage/repos.conf "$(pwd)/etc/portage/repos.conf"
sync_or_copy /var/lib/portage/world "$(pwd)/var/lib/portage/world"
# cfg
sync_or_copy /etc/cfg-update.conf "$(pwd)/etc/cfg-update.conf"
# Grub
sync_or_copy /etc/default/grub "$(pwd)/etc/default"
# Console
sync_or_copy /etc/vconsole.conf "$(pwd)/etc/vconsole.conf"
# Kernel config
sync_or_copy "/usr/src/linux-$(uname -r)/.config" "$(pwd)/usr/src/linux/.config"
# Kernel modules
rsync -a --delete /etc/modules-load.d/ "$(pwd)/etc/modules-load.d/"
# fstab
sync_or_copy /etc/fstab "$(pwd)/etc/fstab"
# Name Service Switch configuration
sync_or_copy /etc/nsswitch.conf "$(pwd)/etc/nsswitch.conf"
# avahi
sync_or_copy /etc/avahi/avahi-daemon.conf "$(pwd)/etc/avahi/avahi-daemon.conf"
# font config
sync_or_copy /etc/fonts/local.conf "$(pwd)/etc/fonts/local.conf"
# pipewire
sync_or_copy /etc/pipewire/pipewire.conf "$(pwd)/etc/pipewire/pipewire.conf"
# pam
sync_or_copy /etc/pam.d/login "$(pwd)/etc/pam.d/login"
# CUPS
sync_or_copy /etc/cups/cupsd.conf "$(pwd)/etc/cups/cupsd.conf"