This commit is contained in:
Jaredy899 2025-01-11 08:27:27 -05:00 committed by GitHub
parent d91a44efab
commit e44b900c0e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
39 changed files with 225 additions and 45 deletions

View File

@ -15,6 +15,9 @@ installMeld() {
apk) apk)
"$ESCALATION_TOOL" "$PACKAGER" add meld "$ESCALATION_TOOL" "$PACKAGER" add meld
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y meld
;;
*) *)
checkFlatpak checkFlatpak
flatpak install -y flathub org.gnome.meld flatpak install -y flathub org.gnome.meld

View File

@ -32,6 +32,9 @@ installNeovim() {
apk) apk)
"$ESCALATION_TOOL" "$PACKAGER" add neovim ripgrep fzf py3-virtualenv luarocks go shellcheck git "$ESCALATION_TOOL" "$PACKAGER" add neovim ripgrep fzf py3-virtualenv luarocks go shellcheck git
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y neovim ripgrep fzf python3-virtualenv luarocks go shellcheck git
;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1 exit 1

View File

@ -28,6 +28,9 @@ installVsCode() {
printf "%b\n" '[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc' | "$ESCALATION_TOOL" tee /etc/yum.repos.d/vscode.repo > /dev/null printf "%b\n" '[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc' | "$ESCALATION_TOOL" tee /etc/yum.repos.d/vscode.repo > /dev/null
"$ESCALATION_TOOL" "$PACKAGER" install -y code "$ESCALATION_TOOL" "$PACKAGER" install -y code
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y vscode
;;
apk) apk)
checkFlatpak checkFlatpak
flatpak install -y flathub com.visualstudio.code flatpak install -y flathub com.visualstudio.code

View File

@ -12,6 +12,9 @@ installAlacritty() {
apk) apk)
"$ESCALATION_TOOL" "$PACKAGER" add alacritty "$ESCALATION_TOOL" "$PACKAGER" add alacritty
;; ;;
bps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y alacritty
;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y alacritty "$ESCALATION_TOOL" "$PACKAGER" install -y alacritty
;; ;;

View File

@ -18,6 +18,9 @@ install_adb() {
apk) apk)
"$ESCALATION_TOOL" "$PACKAGER" add android-tools "$ESCALATION_TOOL" "$PACKAGER" add android-tools
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y android-tools
;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}" printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
exit 1 exit 1

View File

@ -12,6 +12,9 @@ if ! command_exists chromium; then
apk) apk)
"$ESCALATION_TOOL" "$PACKAGER" add chromium "$ESCALATION_TOOL" "$PACKAGER" add chromium
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y chromium
;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y chromium "$ESCALATION_TOOL" "$PACKAGER" install -y chromium
;; ;;

View File

@ -18,6 +18,9 @@ installFirefox() {
dnf) dnf)
"$ESCALATION_TOOL" "$PACKAGER" install -y firefox "$ESCALATION_TOOL" "$PACKAGER" install -y firefox
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y firefox
;;
apk) apk)
"$ESCALATION_TOOL" "$PACKAGER" add firefox "$ESCALATION_TOOL" "$PACKAGER" add firefox
;; ;;

View File

@ -32,6 +32,10 @@ Signed-By: /usr/share/keyrings/librewolf.gpg" | "$ESCALATION_TOOL" tee /etc/apt/
pacman) pacman)
"$AUR_HELPER" -S --needed --noconfirm librewolf-bin "$AUR_HELPER" -S --needed --noconfirm librewolf-bin
;; ;;
xbps-install)
printf '%s\n' 'repository=https://github.com/index-0/librewolf-void/releases/latest/download/' | "$ESCALATION_TOOL" tee /etc/xbps.d/20-librewolf.conf > /dev/null
"$ESCALATION_TOOL" "$PACKAGER" -Syu librewolf
;;
apk) apk)
checkFlatpak checkFlatpak
flatpak install flathub io.gitlab.librewolf-community flatpak install flathub io.gitlab.librewolf-community

View File

@ -12,6 +12,9 @@ installLynx() {
apk) apk)
"$ESCALATION_TOOL" "$PACKAGER" add lynx "$ESCALATION_TOOL" "$PACKAGER" add lynx
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y lynx
;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y lynx "$ESCALATION_TOOL" "$PACKAGER" install -y lynx
;; ;;

View File

@ -18,6 +18,9 @@ installTorBrowser() {
dnf) dnf)
"$ESCALATION_TOOL" "$PACKAGER" install -y torbrowser-launcher "$ESCALATION_TOOL" "$PACKAGER" install -y torbrowser-launcher
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y torbrowser-launcher
;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}${RC}" printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}${RC}"
exit 1 exit 1

View File

@ -20,6 +20,9 @@ installDiscord() {
"$ESCALATION_TOOL" "$PACKAGER" install -y https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm "$ESCALATION_TOOL" "$PACKAGER" install -y https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
"$ESCALATION_TOOL" "$PACKAGER" install -y discord "$ESCALATION_TOOL" "$PACKAGER" install -y discord
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y Signal-Desktop
;;
apk) apk)
checkFlatpak checkFlatpak
flatpak install -y flathub com.discordapp.Discord flatpak install -y flathub com.discordapp.Discord

View File

@ -23,6 +23,9 @@ installSignal() {
checkFlatpak checkFlatpak
flatpak install -y flathub org.signal.Signal flatpak install -y flathub org.signal.Signal
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y Signal-Desktop
;;
apk) apk)
checkFlatpak checkFlatpak
flatpak install -y flathub org.signal.Signal flatpak install -y flathub org.signal.Signal

View File

@ -12,6 +12,9 @@ installTelegram() {
apk) apk)
"$ESCALATION_TOOL" "$PACKAGER" add telegram-desktop "$ESCALATION_TOOL" "$PACKAGER" add telegram-desktop
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y telegram-desktop
;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y telegram-desktop "$ESCALATION_TOOL" "$PACKAGER" install -y telegram-desktop
;; ;;

View File

@ -12,6 +12,9 @@ installThunderBird() {
apk) apk)
"$ESCALATION_TOOL" "$PACKAGER" add thunderbird "$ESCALATION_TOOL" "$PACKAGER" add thunderbird
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y thunderbird
;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y thunderbird "$ESCALATION_TOOL" "$PACKAGER" install -y thunderbird
;; ;;

View File

@ -46,6 +46,9 @@ install_docker() {
apk) apk)
"$ESCALATION_TOOL" "$PACKAGER" add docker "$ESCALATION_TOOL" "$PACKAGER" add docker
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y docker
;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1 exit 1
@ -80,6 +83,9 @@ install_docker_compose() {
apk) apk)
"$ESCALATION_TOOL" "$PACKAGER" add docker-cli-compose "$ESCALATION_TOOL" "$PACKAGER" add docker-cli-compose
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y docker-compose
;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1 exit 1

View File

@ -17,6 +17,9 @@ installFastfetch() {
apk) apk)
"$ESCALATION_TOOL" "$PACKAGER" add fastfetch "$ESCALATION_TOOL" "$PACKAGER" add fastfetch
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y fastfetch
;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y fastfetch "$ESCALATION_TOOL" "$PACKAGER" install -y fastfetch
;; ;;

View File

@ -12,6 +12,9 @@ installKitty() {
apk) apk)
"$ESCALATION_TOOL" "$PACKAGER" add kitty "$ESCALATION_TOOL" "$PACKAGER" add kitty
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y kitty
;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y kitty "$ESCALATION_TOOL" "$PACKAGER" install -y kitty
;; ;;

View File

@ -14,6 +14,9 @@ installDepend() {
apk) apk)
"$ESCALATION_TOOL" "$PACKAGER" add bash bash-completion tar bat tree unzip fontconfig git "$ESCALATION_TOOL" "$PACKAGER" add bash bash-completion tar bat tree unzip fontconfig git
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y bash bash-completion tar bat tree unzip fontconfig git
;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y bash bash-completion tar bat tree unzip fontconfig git "$ESCALATION_TOOL" "$PACKAGER" install -y bash bash-completion tar bat tree unzip fontconfig git
;; ;;

View File

@ -19,6 +19,9 @@ installLibreOffice() {
apk) apk)
"$ESCALATION_TOOL" "$PACKAGER" add libreoffice "$ESCALATION_TOOL" "$PACKAGER" add libreoffice
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y libreoffice
;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1 exit 1

View File

@ -12,6 +12,9 @@ installEvince() {
apk) apk)
"$ESCALATION_TOOL" "$PACKAGER" add evince "$ESCALATION_TOOL" "$PACKAGER" add evince
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y evince
;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y evince "$ESCALATION_TOOL" "$PACKAGER" install -y evince
;; ;;

View File

@ -12,6 +12,9 @@ installOkular() {
apk) apk)
"$ESCALATION_TOOL" "$PACKAGER" add okular "$ESCALATION_TOOL" "$PACKAGER" add okular
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y okular
;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y okular "$ESCALATION_TOOL" "$PACKAGER" install -y okular
;; ;;

View File

@ -18,6 +18,9 @@ installPodmanCompose() {
dnf) dnf)
"$ESCALATION_TOOL" "$PACKAGER" install -y podman-compose "$ESCALATION_TOOL" "$PACKAGER" install -y podman-compose
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y podman-compose
;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}${RC}" printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}${RC}"
exit 1 exit 1

View File

@ -18,6 +18,9 @@ installPodman() {
dnf) dnf)
"$ESCALATION_TOOL" "$PACKAGER" install -y podman "$ESCALATION_TOOL" "$PACKAGER" install -y podman
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y podman
;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}${RC}" printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}${RC}"
exit 1 exit 1

View File

@ -12,6 +12,9 @@ installRofi() {
apk) apk)
"$ESCALATION_TOOL" "$PACKAGER" add rofi "$ESCALATION_TOOL" "$PACKAGER" add rofi
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y rofi
;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y rofi "$ESCALATION_TOOL" "$PACKAGER" install -y rofi
;; ;;

View File

@ -13,6 +13,9 @@ installZsh() {
apk) apk)
"$ESCALATION_TOOL" "$PACKAGER" add zsh "$ESCALATION_TOOL" "$PACKAGER" add zsh
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y zsh
;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y zsh "$ESCALATION_TOOL" "$PACKAGER" install -y zsh
;; ;;

View File

@ -12,6 +12,9 @@ installPkg() {
apk) apk)
"$ESCALATION_TOOL" "$PACKAGER" add ufw "$ESCALATION_TOOL" "$PACKAGER" add ufw
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y ufw
;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y ufw "$ESCALATION_TOOL" "$PACKAGER" install -y ufw
;; ;;

View File

@ -40,6 +40,13 @@ installDepend() {
apk) apk)
"$ESCALATION_TOOL" "$PACKAGER" add build-base multitail tar tree trash-cli unzip cmake jq "$ESCALATION_TOOL" "$PACKAGER" add build-base multitail tar tree trash-cli unzip cmake jq
;; ;;
xbps-install)
COMPILEDEPS='base-devel'
"$ESCALATION_TOOL" "$PACKAGER" -y $DEPENDENCIES $COMPILEDEPS
"$ESCALATION_TOOL" "$PACKAGER" -y void-repo-multilib
"$ESCALATION_TOOL" "$PACKAGER" -Sy
"$ESCALATION_TOOL" "$PACKAGER" -y glibc-32bit gcc-multilib
;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES "$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES
;; ;;

View File

@ -17,6 +17,9 @@ install_theme_tools() {
pacman) pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm qt6ct kvantum "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm qt6ct kvantum
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y qt6ct kvantum
;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1 exit 1

View File

@ -27,6 +27,9 @@ cleanup_system() {
apk) apk)
"$ESCALATION_TOOL" "$PACKAGER" cache clean "$ESCALATION_TOOL" "$PACKAGER" cache clean
;; ;;
xbps-install)
"$ESCALATION_TOOL" xbps-remove -Oo
;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}. Skipping.${RC}" printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}. Skipping.${RC}"
;; ;;

View File

@ -56,6 +56,9 @@ fastUpdate() {
apk) apk)
"$ESCALATION_TOOL" "$PACKAGER" update "$ESCALATION_TOOL" "$PACKAGER" update
;; ;;
xbps-install)
"$ESCALATION_TOOL" xbps-install -S
;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}${RC}" printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}${RC}"
exit 1 exit 1
@ -82,6 +85,9 @@ updateSystem() {
apk) apk)
"$ESCALATION_TOOL" "$PACKAGER" upgrade "$ESCALATION_TOOL" "$PACKAGER" upgrade
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -Su
;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}${RC}" printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}${RC}"
exit 1 exit 1

View File

@ -16,6 +16,9 @@ InstallTermiusFonts() {
dnf) dnf)
"$ESCALATION_TOOL" "$PACKAGER" install -y terminus-fonts-console "$ESCALATION_TOOL" "$PACKAGER" install -y terminus-fonts-console
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y terminus-font
;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1 exit 1
@ -28,7 +31,7 @@ InstallTermiusFonts() {
SetTermiusFonts() { SetTermiusFonts() {
case "$DTYPE" in case "$DTYPE" in
arch) arch|fedora|void)
printf "%b\n" "${YELLOW}Updating FONT= line in /etc/vconsole.conf...${RC}" printf "%b\n" "${YELLOW}Updating FONT= line in /etc/vconsole.conf...${RC}"
"$ESCALATION_TOOL" sed -i 's/^FONT=.*/FONT=ter-v32b/' /etc/vconsole.conf "$ESCALATION_TOOL" sed -i 's/^FONT=.*/FONT=ter-v32b/' /etc/vconsole.conf
if [ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ]; then if [ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ]; then
@ -50,14 +53,6 @@ SetTermiusFonts() {
fi fi
printf "%b\n" "${GREEN}Terminus font has been set for TTY.${RC}" printf "%b\n" "${GREEN}Terminus font has been set for TTY.${RC}"
;; ;;
fedora)
printf "%b\n" "${YELLOW}Updating FONT= line in /etc/vconsole.conf...${RC}"
"$ESCALATION_TOOL" sed -i 's/^FONT=.*/FONT=ter-v32b/' /etc/vconsole.conf
if [ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ]; then
"$ESCALATION_TOOL" setfont -C /dev/tty1 ter-v32b
fi
printf "%b\n" "${GREEN}Terminus font has been set for TTY.${RC}"
;;
esac esac
} }

View File

@ -14,6 +14,9 @@ setupBluetooth() {
apk) apk)
"$ESCALATION_TOOL" "$PACKAGER" add bluez "$ESCALATION_TOOL" "$PACKAGER" add bluez
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y bluez
;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y bluez "$ESCALATION_TOOL" "$PACKAGER" install -y bluez
;; ;;

View File

@ -22,6 +22,9 @@ if ! command_exists openssl; then
apk) apk)
"$ESCALATION_TOOL" "$PACKAGER" add openssl "$ESCALATION_TOOL" "$PACKAGER" add openssl
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y openssl
;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1 exit 1

View File

@ -9,11 +9,11 @@ installCUPS() {
pacman) pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm cups "$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm cups
;; ;;
apt-get | nala) apt-get|nala|dnf)
"$ESCALATION_TOOL" "$PACKAGER" install -y cups "$ESCALATION_TOOL" "$PACKAGER" install -y cups
;; ;;
dnf) xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" install -y cups "$ESCALATION_TOOL" "$PACKAGER" -y cups
;; ;;
*) *)
printf "%b\n" "${RED}Unsupported package manager ${PACKAGER}${RC}" printf "%b\n" "${RED}Unsupported package manager ${PACKAGER}${RC}"

View File

@ -10,12 +10,15 @@ installEpsonPrinterDriver() {
pacman) pacman)
"$AUR_HELPER" -S --noconfirm epson-inkjet-printer-escpr "$AUR_HELPER" -S --noconfirm epson-inkjet-printer-escpr
;; ;;
apt-get | nala) apt-get|nala)
"$ESCALATION_TOOL" "$PACKAGER" install -y printer-driver-escpr "$ESCALATION_TOOL" "$PACKAGER" install -y printer-driver-escpr
;; ;;
dnf) dnf)
"$ESCALATION_TOOL" "$PACKAGER" install -y epson-inkjet-printer-escpr "$ESCALATION_TOOL" "$PACKAGER" install -y epson-inkjet-printer-escpr
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y epson-inkjet-printer-escpr
;;
*) *)
printf "%b\n" "${RED}Unsupported package manager ${PACKAGER}${RC}" printf "%b\n" "${RED}Unsupported package manager ${PACKAGER}${RC}"
exit 1 exit 1

View File

@ -14,6 +14,9 @@ install_package() {
apk) apk)
"$ESCALATION_TOOL" "$PACKAGER" add "$PACKAGE" "$ESCALATION_TOOL" "$PACKAGER" add "$PACKAGE"
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y "$PACKAGE"
;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y "$PACKAGE" "$ESCALATION_TOOL" "$PACKAGER" install -y "$PACKAGE"
;; ;;
@ -41,6 +44,10 @@ setup_ssh() {
install_package openssh install_package openssh
SSH_SERVICE="sshd" SSH_SERVICE="sshd"
;; ;;
xbps-install)
install_package openssh
SSH_SERVICE="sshd"
;;
*) *)
install_package openssh-server install_package openssh-server
SSH_SERVICE="sshd" SSH_SERVICE="sshd"

View File

@ -1,7 +1,8 @@
#!/bin/sh -e #!/bin/sh -e
# Load common script functions # Load common script functions and service functions
. ../common-script.sh . ../common-script.sh
. ../common-service-script.sh
#external services directory #external services directory
SCRIPT_DIR="./services" SCRIPT_DIR="./services"
@ -29,25 +30,67 @@ show_menu() {
# Function to view all services # Function to view all services
view_all_services() { view_all_services() {
printf "%b\n" "Listing all services..." printf "%b\n" "Listing all services..."
"$ESCALATION_TOOL" systemctl list-units --type=service --all --no-legend | awk '{print $1}' | sed 's/\.service//' | more case "$INIT_MANAGER" in
systemctl)
"$ESCALATION_TOOL" systemctl list-units --type=service --all --no-legend | awk '{print $1}' | sed 's/\.service//' | more
;;
rc-service)
"$ESCALATION_TOOL" rc-update show | more
;;
runit)
ls -1 /etc/sv/ | more
;;
esac
} }
# Function to view enabled services # Function to view enabled services
view_enabled_services() { view_enabled_services() {
printf "%b\n" "Listing enabled services..." printf "%b\n" "Listing enabled services..."
"$ESCALATION_TOOL" systemctl list-unit-files --type=service --state=enabled --no-legend | awk '{print $1}' | sed 's/\.service//' | more case "$INIT_MANAGER" in
systemctl)
"$ESCALATION_TOOL" systemctl list-unit-files --type=service --state=enabled --no-legend | awk '{print $1}' | sed 's/\.service//' | more
;;
rc-service)
"$ESCALATION_TOOL" rc-update show -v | grep "\[" | more
;;
runit)
ls -1 /var/service/ | more
;;
esac
} }
# Function to view disabled services # Function to view disabled services
view_disabled_services() { view_disabled_services() {
printf "%b\n" "Listing disabled services..." printf "%b\n" "Listing disabled services..."
"$ESCALATION_TOOL" systemctl list-unit-files --type=service --state=disabled --no-legend | awk '{print $1}' | sed 's/\.service//' | more case "$INIT_MANAGER" in
systemctl)
"$ESCALATION_TOOL" systemctl list-unit-files --type=service --state=disabled --no-legend | awk '{print $1}' | sed 's/\.service//' | more
;;
rc-service)
"$ESCALATION_TOOL" rc-update show -v | grep -v "\[" | more
;;
runit)
ls -1 /etc/sv/ | grep -v "$(ls -1 /var/service/)" | more
;;
esac
} }
# Function to view started services # Function to view started services
view_started_services() { view_started_services() {
printf "%b\n" "Listing started services: " printf "%b\n" "Listing started services..."
"$ESCALATION_TOOL" systemctl list-units --type=service --state=running --no-pager | head -n -6 | awk 'NR>1 {print $1}' | more case "$INIT_MANAGER" in
systemctl)
"$ESCALATION_TOOL" systemctl list-units --type=service --state=running --no-pager | head -n -6 | awk 'NR>1 {print $1}' | more
;;
rc-service)
"$ESCALATION_TOOL" rc-status --servicelist | more
;;
runit)
for service in /var/service/*; do
[ -d "$service" ] && "$ESCALATION_TOOL" sv status "$(basename "$service")" | grep "^run:" >/dev/null && basename "$service"
done | more
;;
esac
} }
# Function to add a new service # Function to add a new service
@ -104,8 +147,7 @@ add_service() {
read -r START_ENABLE read -r START_ENABLE
if [ "$START_ENABLE" = "y" ] || [ "$START_ENABLE" = "Y" ]; then if [ "$START_ENABLE" = "y" ] || [ "$START_ENABLE" = "Y" ]; then
"$ESCALATION_TOOL" systemctl start "$SERVICE_NAME" startAndEnableService "$SERVICE_NAME"
"$ESCALATION_TOOL" systemctl enable "$SERVICE_NAME"
printf "%b\n" "Service $SERVICE_NAME has been started and enabled." printf "%b\n" "Service $SERVICE_NAME has been started and enabled."
else else
printf "%b\n" "Service $SERVICE_NAME has been created but not started." printf "%b\n" "Service $SERVICE_NAME has been created but not started."
@ -117,20 +159,42 @@ remove_service() {
printf "%b" "Enter the name of the service to remove (e.g., my_service): " printf "%b" "Enter the name of the service to remove (e.g., my_service): "
read -r SERVICE_NAME read -r SERVICE_NAME
SERVICE_FILE="/etc/systemd/system/$SERVICE_NAME.service" if isServiceActive "$SERVICE_NAME"; then
if [ -f "$SERVICE_FILE" ]; then
printf "%b\n" "Stopping and disabling the service..." printf "%b\n" "Stopping and disabling the service..."
"$ESCALATION_TOOL" systemctl stop "$SERVICE_NAME" stopService "$SERVICE_NAME"
"$ESCALATION_TOOL" systemctl disable "$SERVICE_NAME" disableService "$SERVICE_NAME"
printf "%b\n" "Removing the service file..."
"$ESCALATION_TOOL" rm -f "$SERVICE_FILE"
"$ESCALATION_TOOL" systemctl daemon-reload
printf "%b\n" "Service $SERVICE_NAME has been removed."
else
printf "%b\n" "Service $SERVICE_NAME does not exist."
fi fi
case "$INIT_MANAGER" in
systemctl)
SERVICE_FILE="/etc/systemd/system/$SERVICE_NAME.service"
if [ -f "$SERVICE_FILE" ]; then
"$ESCALATION_TOOL" rm -f "$SERVICE_FILE"
"$ESCALATION_TOOL" systemctl daemon-reload
printf "%b\n" "Service $SERVICE_NAME has been removed."
else
printf "%b\n" "Service $SERVICE_NAME does not exist."
fi
;;
rc-service)
SERVICE_FILE="/etc/init.d/$SERVICE_NAME"
if [ -f "$SERVICE_FILE" ]; then
"$ESCALATION_TOOL" rm -f "$SERVICE_FILE"
printf "%b\n" "Service $SERVICE_NAME has been removed."
else
printf "%b\n" "Service $SERVICE_NAME does not exist."
fi
;;
runit)
SERVICE_DIR="/etc/sv/$SERVICE_NAME"
if [ -d "$SERVICE_DIR" ]; then
"$ESCALATION_TOOL" rm -rf "$SERVICE_DIR"
printf "%b\n" "Service $SERVICE_NAME has been removed."
else
printf "%b\n" "Service $SERVICE_NAME does not exist."
fi
;;
esac
} }
# Function to start a service # Function to start a service
@ -139,7 +203,7 @@ start_service() {
printf "%b" "Enter the name of the service to start (e.g., my_service): " printf "%b" "Enter the name of the service to start (e.g., my_service): "
read -r SERVICE_NAME read -r SERVICE_NAME
if "$ESCALATION_TOOL" systemctl start "$SERVICE_NAME"; then if startService "$SERVICE_NAME"; then
printf "%b\n" "Service $SERVICE_NAME has been started." printf "%b\n" "Service $SERVICE_NAME has been started."
else else
printf "%b\n" "Failed to start service: $SERVICE_NAME." printf "%b\n" "Failed to start service: $SERVICE_NAME."
@ -152,7 +216,7 @@ stop_service() {
printf "%b" "Enter the name of the service to stop (e.g., my_service): " printf "%b" "Enter the name of the service to stop (e.g., my_service): "
read -r SERVICE_NAME read -r SERVICE_NAME
if "$ESCALATION_TOOL" systemctl stop "$SERVICE_NAME"; then if stopService "$SERVICE_NAME"; then
printf "%b\n" "Service $SERVICE_NAME has been stopped." printf "%b\n" "Service $SERVICE_NAME has been stopped."
else else
printf "%b\n" "Failed to stop service: $SERVICE_NAME." printf "%b\n" "Failed to stop service: $SERVICE_NAME."
@ -165,29 +229,28 @@ enable_service() {
printf "%b" "Enter the name of the service to enable (e.g., my_service): " printf "%b" "Enter the name of the service to enable (e.g., my_service): "
read -r SERVICE_NAME read -r SERVICE_NAME
if "$ESCALATION_TOOL" systemctl enable "$SERVICE_NAME"; then if enableService "$SERVICE_NAME"; then
printf "%b\n" "Service $SERVICE_NAME has been enabled." printf "%b\n" "Service $SERVICE_NAME has been enabled."
else else
printf "%b\n" "Failed to enable service: $SERVICE_NAME." printf "%b\n" "Failed to enable service: $SERVICE_NAME."
fi fi
} }
# Function to enable a service # Function to disable a service
disable_service() { disable_service() {
view_enabled_services view_enabled_services
printf "%b" "Enter the name of the service to disable (e.g., my_service): " printf "%b" "Enter the name of the service to disable (e.g., my_service): "
read -r SERVICE_NAME read -r SERVICE_NAME
if "$ESCALATION_TOOL" systemctl disable "$SERVICE_NAME"; then if disableService "$SERVICE_NAME"; then
printf "%b\n" "Service $SERVICE_NAME has been enabled." printf "%b\n" "Service $SERVICE_NAME has been disabled."
else else
printf "%b\n" "Failed to enable service: $SERVICE_NAME." printf "%b\n" "Failed to disable service: $SERVICE_NAME."
fi fi
} }
# Function to create, start, and enable a service from an external service file # Function to create service from external
create_service_from_external() { create_service_from_external() {
# List all .service files in the SCRIPT_DIR # List all .service files in the SCRIPT_DIR
printf "%b\n" "============================" printf "%b\n" "============================"
printf "%b\n" "Listing available service files" printf "%b\n" "Listing available service files"
@ -237,8 +300,7 @@ create_service_from_external() {
read -r START_ENABLE read -r START_ENABLE
if [ "$START_ENABLE" = "y" ]; then if [ "$START_ENABLE" = "y" ]; then
"$ESCALATION_TOOL" systemctl start "$SERVICE_NAME" startAndEnableService "$SERVICE_NAME"
"$ESCALATION_TOOL" systemctl enable "$SERVICE_NAME"
printf "%b\n" "Service $SERVICE_NAME has been started and enabled." printf "%b\n" "Service $SERVICE_NAME has been started and enabled."
else else
printf "%b\n" "Service $SERVICE_NAME has been created but not started." printf "%b\n" "Service $SERVICE_NAME has been created but not started."

View File

@ -16,6 +16,9 @@ setup_xrandr() {
apk) apk)
"$ESCALATION_TOOL" "$PACKAGER" add xrandr "$ESCALATION_TOOL" "$PACKAGER" add xrandr
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y xrandr
;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y xorg-x11-server-utils "$ESCALATION_TOOL" "$PACKAGER" install -y xorg-x11-server-utils
;; ;;

View File

@ -17,6 +17,9 @@ setupNetworkManager() {
apk) apk)
"$ESCALATION_TOOL" "$PACKAGER" add networkmanager-wifi iwd "$ESCALATION_TOOL" "$PACKAGER" add networkmanager-wifi iwd
;; ;;
xbps-install)
"$ESCALATION_TOOL" "$PACKAGER" -y NetworkManager iwd
;;
*) *)
"$ESCALATION_TOOL" "$PACKAGER" install -y network-manager "$ESCALATION_TOOL" "$PACKAGER" install -y network-manager
;; ;;