Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions core/tabs/system-setup/alpine/alpine-upgrade.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/sh -e

. ../../common-script.sh

upgradeAlpine() {
printf "%b\n" "${YELLOW}Backing up repositories file...${RC}"
"$ESCALATION_TOOL" cp /etc/apk/repositories /etc/apk/repositories.backup

printf "%b\n" "${YELLOW}Choose Alpine version:${RC}"
printf "%b\n" "${CYAN}1) Latest Stable${RC}"
printf "%b\n" "${CYAN}2) Edge (rolling)${RC}"
printf "%b" "Enter your choice (1 or 2): "
read -r choice

case $choice in
1)
printf "%b\n" "${YELLOW}Updating repositories to latest stable...${RC}"
"$ESCALATION_TOOL" sh -c 'cat > /etc/apk/repositories << EOF
https://dl-cdn.alpinelinux.org/alpine/latest-stable/main
https://dl-cdn.alpinelinux.org/alpine/latest-stable/community
EOF'
;;
2)
printf "%b\n" "${YELLOW}Updating repositories to edge...${RC}"
"$ESCALATION_TOOL" sh -c 'cat > /etc/apk/repositories << EOF
https://dl-cdn.alpinelinux.org/alpine/edge/main
https://dl-cdn.alpinelinux.org/alpine/edge/community
https://dl-cdn.alpinelinux.org/alpine/edge/testing
EOF'
;;
*)
printf "%b\n" "${RED}Invalid choice. Exiting...${RC}"
exit 1
;;
esac

printf "%b\n" "${YELLOW}Updating package index...${RC}"
"$ESCALATION_TOOL" "$PACKAGER" update

printf "%b\n" "${YELLOW}Upgrading all packages...${RC}"
"$ESCALATION_TOOL" "$PACKAGER" upgrade --available

printf "%b\n" "${GREEN}Upgrade completed!${RC}"
printf "%b\n" "${YELLOW}Note: If you encounter any issues, you can restore your previous repositories file from /etc/apk/repositories.backup${RC}"
}

checkEnv
upgradeAlpine
17 changes: 16 additions & 1 deletion core/tabs/system-setup/tab_data.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
name = "System Setup"

[[data]]
name = "Arch Linux"
name = "Alpine"

[[data.preconditions]]
matches = true
data = "command_exists"
values = ["apk"]

[[data.entries]]
name = "Alpine Update"
description = "Upgrades Alpine Linux to either latest stable or edge repositories"
script = "alpine/alpine-upgrade.sh"
task_list = "P MP"
multi_select = false

[[data]]
name = "Arch"

[[data.preconditions]]
matches = true
Expand Down