mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-26 06:46:04 +00:00
data.preconditions added - escalation tool used
This commit is contained in:
parent
85588c6a10
commit
7e09b49abb
|
@ -13,7 +13,7 @@ installBtrfsStack() {
|
||||||
printf "%b\n" "${YELLOW}==========================================${RC}"
|
printf "%b\n" "${YELLOW}==========================================${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
dnf)
|
dnf)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y btrfs-assistant python3-dnf-plugin-snapper
|
"$ESCALATION_TOOL" dnf install -y btrfs-assistant python3-dnf-plugin-snapper
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
|
@ -27,11 +27,11 @@ installBtrfsStack() {
|
||||||
|
|
||||||
# Create first snapper config for root and home and create new manual snapshots
|
# Create first snapper config for root and home and create new manual snapshots
|
||||||
configureSnapper() {
|
configureSnapper() {
|
||||||
printf "%b\n" "${YELLOW}==========================================================================${RC}"
|
printf "%b\n" "${YELLOW}===========================================================================${RC}"
|
||||||
printf "%b\n" "${YELLOW}Creating snapper root(/) and home config and taking the first snapshots...${RC}"
|
printf "%b\n" "${YELLOW}Creating snapper root(/) and /home config and taking the first snapshots...${RC}"
|
||||||
printf "%b\n" "${YELLOW}==========================================================================${RC}"
|
printf "%b\n" "${YELLOW}===========================================================================${RC}"
|
||||||
snapper -c home create-config /home && snapper -c home create --description "First home Snapshot"
|
"$ESCALATION_TOOL" snapper -c home create-config /home && "$ESCALATION_TOOL" snapper -c home create --description "First home Snapshot"
|
||||||
snapper -c root create-config / && snapper -c root create --description "First root Snapshot"
|
"$ESCALATION_TOOL" snapper -c root create-config / && "$ESCALATION_TOOL" snapper -c root create --description "First root Snapshot"
|
||||||
printf "%b\n" "${YELLOW}Updating timeline settings...${RC}"
|
printf "%b\n" "${YELLOW}Updating timeline settings...${RC}"
|
||||||
# Modifyling default timeline root config
|
# Modifyling default timeline root config
|
||||||
"$ESCALATION_TOOL" sed -i'' '
|
"$ESCALATION_TOOL" sed -i'' '
|
||||||
|
@ -57,8 +57,8 @@ serviceStartEnable() {
|
||||||
printf "%b\n" "${YELLOW}==================================================================================${RC}"
|
printf "%b\n" "${YELLOW}==================================================================================${RC}"
|
||||||
printf "%b\n" "${YELLOW}Starting and enabling snapper-timeline.timer and snapper-cleanup.timer services...${RC}"
|
printf "%b\n" "${YELLOW}Starting and enabling snapper-timeline.timer and snapper-cleanup.timer services...${RC}"
|
||||||
printf "%b\n" "${YELLOW}==================================================================================${RC}"
|
printf "%b\n" "${YELLOW}==================================================================================${RC}"
|
||||||
systemctl start snapper-timeline.timer && systemctl enable snapper-timeline.timer #enables scheduled timeline snapshots
|
"$ESCALATION_TOOL" systemctl enable --now snapper-timeline.timer
|
||||||
systemctl start snapper-cleanup.timer && systemctl enable snapper-cleanup.timer #enables scheduled snapshot cleanup
|
"$ESCALATION_TOOL" systemctl enable --now snapper-cleanup.timer
|
||||||
printf "%b\n" "${GREEN}Snapper services started and enabled.${RC}"
|
printf "%b\n" "${GREEN}Snapper services started and enabled.${RC}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ installGrubBtrfs() {
|
||||||
sed -i'' '/#GRUB_BTRFS_SCRIPT_CHECK=/a GRUB_BTRFS_SCRIPT_CHECK=grub2-script-check' config
|
sed -i'' '/#GRUB_BTRFS_SCRIPT_CHECK=/a GRUB_BTRFS_SCRIPT_CHECK=grub2-script-check' config
|
||||||
"$ESCALATION_TOOL" make install
|
"$ESCALATION_TOOL" make install
|
||||||
printf "%b\n" "${YELLOW}Updating grub configuration and enabling grub-btrfsd service...${RC}"
|
printf "%b\n" "${YELLOW}Updating grub configuration and enabling grub-btrfsd service...${RC}"
|
||||||
"$ESCALATION_TOOL" grub2-mkconfig -o /boot/grub2/grub.cfg && systemctl enable --now grub-btrfsd.service
|
"$ESCALATION_TOOL" grub2-mkconfig -o /boot/grub2/grub.cfg && "$ESCALATION_TOOL" systemctl enable --now grub-btrfsd.service
|
||||||
printf "%b\n" "${YELLOW}Cleaning up installation files...${RC}"
|
printf "%b\n" "${YELLOW}Cleaning up installation files...${RC}"
|
||||||
cd .. && rm -rf "$HOME/grub-btrfs"
|
cd .. && rm -rf "$HOME/grub-btrfs"
|
||||||
printf "%b\n" "${GREEN}Grub-btrfs installed and service enabled.${RC}"
|
printf "%b\n" "${GREEN}Grub-btrfs installed and service enabled.${RC}"
|
||||||
|
@ -161,7 +161,6 @@ someNotices() {
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
checkFs
|
|
||||||
installBtrfsStack
|
installBtrfsStack
|
||||||
configureSnapper
|
configureSnapper
|
||||||
serviceStartEnable
|
serviceStartEnable
|
||||||
|
|
|
@ -71,6 +71,11 @@ description = "Installs Btrfs Assistant, Snapper, dnf snapper plugin and takes t
|
||||||
script = "fedora/fedora-btrfs-assistant.sh"
|
script = "fedora/fedora-btrfs-assistant.sh"
|
||||||
task_list = "I PFM SS"
|
task_list = "I PFM SS"
|
||||||
|
|
||||||
|
[[data.preconditions]]
|
||||||
|
matches = true
|
||||||
|
data = "command_exists"
|
||||||
|
values = [ "btrfs" ]
|
||||||
|
|
||||||
[[data]]
|
[[data]]
|
||||||
name = "Build Prerequisites"
|
name = "Build Prerequisites"
|
||||||
description = "This script is designed to handle the installation of various software dependencies across different Linux distributions"
|
description = "This script is designed to handle the installation of various software dependencies across different Linux distributions"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user