-
Notifications
You must be signed in to change notification settings - Fork 1
/
cleanup.sh
executable file
·44 lines (38 loc) · 1.07 KB
/
cleanup.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
#!/usr/bin/bash
#shellcheck disable=SC2115
set ${SET_X:+-x} -eou pipefail
repos=(
_copr_ublue-os-akmods.repo
_copr_ublue-os-staging.repo
_copr_kylegospo-latencyflex.repo
_copr_kylegospo-obs-vkcapture.repo
_copr_kylegospo-webapp-manager.repo
_copr_che-nerd-fonts.repo
_copr_hikariknight-looking-glass-kvmfr.repo
charm.repo
docker-ce.repo
fedora-updates.repo
fedora-updates-archive.repo
tailscale.repo
ublue-os-bling-fedora-*.repo
ublue-os-staging-fedora-*.repo
vscode.repo
)
for repo in "${repos[@]}"; do
if [[ -f "/etc/yum.repos.d/$repo" ]]; then
sed -i 's@enabled=1@enabled=0@g' "/etc/yum.repos.d/$repo"
fi
done
if [[ ! "${IMAGE}" =~ ucore ]]; then
coprs=($(find /etc/yum.repos.d/_copr*.repo))
for copr in "${coprs[@]}"; do
sed -i 's@enabled=1@enabled=0@g' "$copr"
done
fi
mv /var/lib/alternatives /staged-alternatives
rm -rf /tmp/*
rm -rf /var/*
ostree container commit
mkdir -p /tmp
mkdir -p /var/lib/ && mv /staged-alternatives /var/lib/alternatives
mkdir -p /var/tmp && chmod -R 1777 /var/tmp