mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-25 22:36:03 +00:00
Merge 29d8958197
into 8ea3da9843
This commit is contained in:
commit
5823ed7568
|
@ -1,2 +1,3 @@
|
||||||
external-sources=true
|
external-sources=true
|
||||||
source=core/tabs/common-script.sh
|
source=core/tabs/common-script.sh
|
||||||
|
source=core/tabs/common-service-script.sh
|
|
@ -12,6 +12,9 @@ installMeld() {
|
||||||
apt-get|nala)
|
apt-get|nala)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -y install meld
|
"$ESCALATION_TOOL" "$PACKAGER" -y install meld
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" add meld
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
checkFlatpak
|
checkFlatpak
|
||||||
flatpak install -y flathub org.gnome.meld
|
flatpak install -y flathub org.gnome.meld
|
||||||
|
|
|
@ -29,6 +29,9 @@ installNeovim() {
|
||||||
dnf|zypper)
|
dnf|zypper)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y neovim ripgrep fzf python3-virtualenv luarocks golang ShellCheck git
|
"$ESCALATION_TOOL" "$PACKAGER" install -y neovim ripgrep fzf python3-virtualenv luarocks golang ShellCheck git
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" add neovim ripgrep fzf py3-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
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
. ../../common-script.sh
|
. ../../common-script.sh
|
||||||
|
|
||||||
installVsCode() {
|
installVsCode() {
|
||||||
if ! command_exists code; then
|
if ! command_exists com.visualstudio.code && ! command_exists code; then
|
||||||
printf "%b\n" "${YELLOW}Installing VS Code..${RC}."
|
printf "%b\n" "${YELLOW}Installing VS Code..${RC}."
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
apt-get|nala)
|
apt-get|nala)
|
||||||
|
@ -28,6 +28,10 @@ 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
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
checkFlatpak
|
||||||
|
flatpak install -y flathub com.visualstudio.code
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
. ../../common-script.sh
|
. ../../common-script.sh
|
||||||
|
|
||||||
installVsCodium() {
|
installVsCodium() {
|
||||||
if ! command_exists codium; then
|
if ! command_exists com.vscodium.codium && ! command_exists codium; then
|
||||||
printf "%b\n" "${YELLOW}Installing VS Codium...${RC}"
|
printf "%b\n" "${YELLOW}Installing VS Codium...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
apt-get|nala)
|
apt-get|nala)
|
||||||
|
@ -26,6 +26,10 @@ installVsCodium() {
|
||||||
printf "%b\n" "[gitlab.com_paulcarroty_vscodium_repo]\nname=download.vscodium.com\nbaseurl=https://download.vscodium.com/rpms/\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/-/raw/master/pub.gpg\nmetadata_expire=1h" | "$ESCALATION_TOOL" tee -a /etc/yum.repos.d/vscodium.repo
|
printf "%b\n" "[gitlab.com_paulcarroty_vscodium_repo]\nname=download.vscodium.com\nbaseurl=https://download.vscodium.com/rpms/\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/-/raw/master/pub.gpg\nmetadata_expire=1h" | "$ESCALATION_TOOL" tee -a /etc/yum.repos.d/vscodium.repo
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y codium
|
"$ESCALATION_TOOL" "$PACKAGER" install -y codium
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
checkFlatpak
|
||||||
|
flatpak install -y flathub com.vscodium.codium
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -9,6 +9,9 @@ installAlacritty() {
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm alacritty
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm alacritty
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" add alacritty
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y alacritty
|
"$ESCALATION_TOOL" "$PACKAGER" install -y alacritty
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -15,6 +15,9 @@ install_adb() {
|
||||||
dnf|zypper)
|
dnf|zypper)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y android-tools
|
"$ESCALATION_TOOL" "$PACKAGER" install -y android-tools
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" add android-tools
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
. ../../common-script.sh
|
. ../../common-script.sh
|
||||||
|
|
||||||
installBrave() {
|
installBrave() {
|
||||||
if ! command_exists brave; then
|
if ! command_exists com.brave.Browser && ! command_exists brave; then
|
||||||
printf "%b\n" "${YELLOW}Installing Brave...${RC}"
|
printf "%b\n" "${YELLOW}Installing Brave...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
apt-get|nala)
|
apt-get|nala)
|
||||||
|
@ -29,6 +29,10 @@ installBrave() {
|
||||||
"$ESCALATION_TOOL" rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc
|
"$ESCALATION_TOOL" rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y brave-browser
|
"$ESCALATION_TOOL" "$PACKAGER" install -y brave-browser
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
checkFlatpak
|
||||||
|
flatpak install -y flathub com.brave.Browser
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -9,6 +9,9 @@ if ! command_exists chromium; then
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm chromium
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm chromium
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" add chromium
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y chromium
|
"$ESCALATION_TOOL" "$PACKAGER" install -y chromium
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -18,6 +18,9 @@ installFirefox() {
|
||||||
dnf)
|
dnf)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y firefox
|
"$ESCALATION_TOOL" "$PACKAGER" install -y firefox
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" add firefox
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
. ../../common-script.sh
|
. ../../common-script.sh
|
||||||
|
|
||||||
installLibreWolf() {
|
installLibreWolf() {
|
||||||
if ! command_exists librewolf; then
|
if ! command_exists io.gitlab.librewolf-community && ! command_exists librewolf; then
|
||||||
printf "%b\n" "${YELLOW}Installing Librewolf...${RC}"
|
printf "%b\n" "${YELLOW}Installing Librewolf...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
apt-get|nala)
|
apt-get|nala)
|
||||||
|
@ -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
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
checkFlatpak
|
||||||
|
flatpak install flathub io.gitlab.librewolf-community
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -9,6 +9,9 @@ installLynx() {
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm lynx
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm lynx
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" add lynx
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y lynx
|
"$ESCALATION_TOOL" "$PACKAGER" install -y lynx
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -22,6 +22,7 @@ installThrorium() {
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
|
|
|
@ -3,14 +3,14 @@
|
||||||
. ../../common-script.sh
|
. ../../common-script.sh
|
||||||
|
|
||||||
installWaterfox() {
|
installWaterfox() {
|
||||||
if ! command_exists waterfox; then
|
if ! command_exists net.waterfox.waterfox && ! command_exists waterfox; then
|
||||||
printf "%b\n" "${YELLOW}Installing waterfox...${RC}"
|
printf "%b\n" "${YELLOW}Installing waterfox...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
pacman)
|
pacman)
|
||||||
"$AUR_HELPER" -S --needed --noconfirm waterfox-bin
|
"$AUR_HELPER" -S --needed --noconfirm waterfox-bin
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
. ../setup-flatpak.sh
|
checkFlatpak
|
||||||
flatpak install -y flathub net.waterfox.waterfox
|
flatpak install -y flathub net.waterfox.waterfox
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
. ../../common-script.sh
|
. ../../common-script.sh
|
||||||
|
|
||||||
installDiscord() {
|
installDiscord() {
|
||||||
if ! command_exists discord; then
|
if ! command_exists com.discordapp.Discord && ! command_exists discord; then
|
||||||
printf "%b\n" "${YELLOW}Installing Discord...${RC}"
|
printf "%b\n" "${YELLOW}Installing Discord...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
apt-get|nala)
|
apt-get|nala)
|
||||||
|
@ -20,6 +20,10 @@ 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
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
checkFlatpak
|
||||||
|
flatpak install -y flathub com.discordapp.Discord
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
. ../../common-script.sh
|
. ../../common-script.sh
|
||||||
|
|
||||||
installJitsi() {
|
installJitsi() {
|
||||||
if ! command_exists jitsi-meet; then
|
if ! command_exists org.jitsi.jitsi-meet && ! command_exists jitsi-meet; then
|
||||||
printf "%b\n" "${YELLOW}Installing Jitsi meet...${RC}"
|
printf "%b\n" "${YELLOW}Installing Jitsi meet...${RC}"
|
||||||
case "$PACKAGER" in
|
case "$PACKAGER" in
|
||||||
apt-get|nala)
|
apt-get|nala)
|
||||||
|
@ -21,6 +21,10 @@ installJitsi() {
|
||||||
dnf)
|
dnf)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y jitsi-meet
|
"$ESCALATION_TOOL" "$PACKAGER" install -y jitsi-meet
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
checkFlatpak
|
||||||
|
flatpak install flathub org.jitsi.jitsi-meet
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -23,6 +23,10 @@ installSignal() {
|
||||||
checkFlatpak
|
checkFlatpak
|
||||||
flatpak install -y flathub org.signal.Signal
|
flatpak install -y flathub org.signal.Signal
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
checkFlatpak
|
||||||
|
flatpak install -y flathub org.signal.Signal
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -9,6 +9,9 @@ installTelegram() {
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm telegram-desktop
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm telegram-desktop
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" add telegram-desktop
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y telegram-desktop
|
"$ESCALATION_TOOL" "$PACKAGER" install -y telegram-desktop
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -9,6 +9,9 @@ installThunderBird() {
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm thunderbird
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm thunderbird
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" add thunderbird
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y thunderbird
|
"$ESCALATION_TOOL" "$PACKAGER" install -y thunderbird
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
|
|
||||||
. ../common-script.sh
|
. ../common-script.sh
|
||||||
|
. ../common-service-script.sh
|
||||||
|
|
||||||
# Function to prompt the user for installation choice
|
# Function to prompt the user for installation choice
|
||||||
choose_installation() {
|
choose_installation() {
|
||||||
clear
|
|
||||||
printf "%b\n" "${YELLOW}Choose what to install:${RC}"
|
printf "%b\n" "${YELLOW}Choose what to install:${RC}"
|
||||||
printf "%b\n" "1. ${YELLOW}Docker${RC}"
|
printf "%b\n" "1. ${YELLOW}Docker${RC}"
|
||||||
printf "%b\n" "2. ${YELLOW}Docker Compose${RC}"
|
printf "%b\n" "2. ${YELLOW}Docker Compose${RC}"
|
||||||
|
@ -34,19 +34,20 @@ install_docker() {
|
||||||
;;
|
;;
|
||||||
zypper)
|
zypper)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install docker
|
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install docker
|
||||||
"$ESCALATION_TOOL" systemctl enable docker
|
|
||||||
"$ESCALATION_TOOL" systemctl start docker
|
|
||||||
;;
|
;;
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm docker
|
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm docker
|
||||||
"$ESCALATION_TOOL" systemctl enable docker
|
;;
|
||||||
"$ESCALATION_TOOL" systemctl start docker
|
apk)
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" add docker
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
startAndEnableService docker
|
||||||
}
|
}
|
||||||
|
|
||||||
install_docker_compose() {
|
install_docker_compose() {
|
||||||
|
@ -66,6 +67,9 @@ install_docker_compose() {
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm docker-compose
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm docker-compose
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" add docker-cli-compose
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -14,6 +14,9 @@ installFastfetch() {
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y /tmp/fastfetch.deb
|
"$ESCALATION_TOOL" "$PACKAGER" install -y /tmp/fastfetch.deb
|
||||||
rm /tmp/fastfetch.deb
|
rm /tmp/fastfetch.deb
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" add fastfetch
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y fastfetch
|
"$ESCALATION_TOOL" "$PACKAGER" install -y fastfetch
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -9,6 +9,9 @@ installKitty() {
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm kitty
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm kitty
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" add kitty
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y kitty
|
"$ESCALATION_TOOL" "$PACKAGER" install -y kitty
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -45,6 +45,13 @@ installLinutil() {
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||||
. $HOME/.cargo/env
|
. $HOME/.cargo/env
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" add build-base
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" add rustup
|
||||||
|
rustup-init
|
||||||
|
# shellcheck disable=SC1091
|
||||||
|
. "$HOME/.cargo/env"
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||||
. $HOME/.cargo/env
|
. $HOME/.cargo/env
|
||||||
|
|
|
@ -19,6 +19,13 @@ updateLinutil() {
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||||||
. $HOME/.cargo/env
|
. $HOME/.cargo/env
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" add build-base
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" add rustup
|
||||||
|
rustup-init
|
||||||
|
# shellcheck disable=SC1091
|
||||||
|
. "$HOME/.cargo/env"
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y rustup
|
"$ESCALATION_TOOL" "$PACKAGER" install -y rustup
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -11,6 +11,9 @@ installDepend() {
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm bash bash-completion tar bat tree unzip fontconfig git
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm bash bash-completion tar bat tree unzip fontconfig git
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" add 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
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -16,6 +16,9 @@ installLibreOffice() {
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm libreoffice-fresh
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm libreoffice-fresh
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" add libreoffice
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -9,6 +9,9 @@ installEvince() {
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm evince
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm evince
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" add evince
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y evince
|
"$ESCALATION_TOOL" "$PACKAGER" install -y evince
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -9,6 +9,9 @@ installOkular() {
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm okular
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm okular
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" add okular
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y okular
|
"$ESCALATION_TOOL" "$PACKAGER" install -y okular
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -9,6 +9,9 @@ installRofi() {
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm rofi
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm rofi
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" add rofi
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y rofi
|
"$ESCALATION_TOOL" "$PACKAGER" install -y rofi
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -10,6 +10,9 @@ installZsh() {
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm zsh
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm zsh
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" add zsh
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y zsh
|
"$ESCALATION_TOOL" "$PACKAGER" install -y zsh
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -123,6 +123,12 @@ checkPackageManager() {
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
## Enable apk community packages
|
||||||
|
if [ "$PACKAGER" = "apk" ] && grep -qE '^#.*community' /etc/apk/repositories; then
|
||||||
|
"$ESCALATION_TOOL" sed -i '/community/s/^#//' /etc/apk/repositories
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" update
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "$PACKAGER" ]; then
|
if [ -z "$PACKAGER" ]; then
|
||||||
printf "%b\n" "${RED}Can't find a supported package manager${RC}"
|
printf "%b\n" "${RED}Can't find a supported package manager${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -169,7 +175,7 @@ checkEnv() {
|
||||||
checkArch
|
checkArch
|
||||||
checkEscalationTool
|
checkEscalationTool
|
||||||
checkCommandRequirements "curl groups $ESCALATION_TOOL"
|
checkCommandRequirements "curl groups $ESCALATION_TOOL"
|
||||||
checkPackageManager 'nala apt-get dnf pacman zypper'
|
checkPackageManager 'nala apt-get dnf pacman zypper apk'
|
||||||
checkCurrentDirectoryWritable
|
checkCurrentDirectoryWritable
|
||||||
checkSuperUser
|
checkSuperUser
|
||||||
checkDistro
|
checkDistro
|
||||||
|
|
85
core/tabs/common-service-script.sh
Normal file
85
core/tabs/common-service-script.sh
Normal file
|
@ -0,0 +1,85 @@
|
||||||
|
#!/bin/sh -e
|
||||||
|
|
||||||
|
checkInitManager() {
|
||||||
|
for manager in $1; do
|
||||||
|
if command_exists "$manager"; then
|
||||||
|
INIT_MANAGER="$manager"
|
||||||
|
printf "%b\n" "${CYAN}Using ${manager} to interact with init system${RC}"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -z "$INIT_MANAGER" ]; then
|
||||||
|
printf "%b\n" "${RED}Can't find a supported init system${RC}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
startService() {
|
||||||
|
case "$INIT_MANAGER" in
|
||||||
|
systemctl)
|
||||||
|
"$ESCALATION_TOOL" "$INIT_MANAGER" start "$1"
|
||||||
|
;;
|
||||||
|
rc-service)
|
||||||
|
"$ESCALATION_TOOL" "$INIT_MANAGER" "$1" start
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
stopService() {
|
||||||
|
case "$INIT_MANAGER" in
|
||||||
|
systemctl)
|
||||||
|
"$ESCALATION_TOOL" "$INIT_MANAGER" stop "$1"
|
||||||
|
;;
|
||||||
|
rc-service)
|
||||||
|
"$ESCALATION_TOOL" "$INIT_MANAGER" "$1" stop
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
enableService() {
|
||||||
|
case "$INIT_MANAGER" in
|
||||||
|
systemctl)
|
||||||
|
"$ESCALATION_TOOL" "$INIT_MANAGER" enable "$1"
|
||||||
|
;;
|
||||||
|
rc-service)
|
||||||
|
"$ESCALATION_TOOL" rc-update add "$1"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
disableService() {
|
||||||
|
case "$INIT_MANAGER" in
|
||||||
|
systemctl)
|
||||||
|
"$ESCALATION_TOOL" "$INIT_MANAGER" disable "$1"
|
||||||
|
;;
|
||||||
|
rc-service)
|
||||||
|
"$ESCALATION_TOOL" rc-update del "$1"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
startAndEnableService() {
|
||||||
|
case "$INIT_MANAGER" in
|
||||||
|
systemctl)
|
||||||
|
"$ESCALATION_TOOL" "$INIT_MANAGER" enable --now "$1"
|
||||||
|
;;
|
||||||
|
rc-service)
|
||||||
|
enableService "$1"
|
||||||
|
startService "$1"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
isServiceActive() {
|
||||||
|
case "$INIT_MANAGER" in
|
||||||
|
systemctl)
|
||||||
|
"$ESCALATION_TOOL" "$INIT_MANAGER" is-active --quiet "$1"
|
||||||
|
;;
|
||||||
|
rc-service)
|
||||||
|
"$ESCALATION_TOOL" "$INIT_MANAGER" "$1" status --quiet
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
checkInitManager 'systemctl rc-service'
|
|
@ -9,6 +9,9 @@ installPkg() {
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm ufw
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm ufw
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" add ufw
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y ufw
|
"$ESCALATION_TOOL" "$PACKAGER" install -y ufw
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -37,6 +37,9 @@ installDepend() {
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install $DEPENDENCIES $COMPILEDEPS
|
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install $DEPENDENCIES $COMPILEDEPS
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install libgcc_s1-gcc7-32bit glibc-devel-32bit
|
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install libgcc_s1-gcc7-32bit glibc-devel-32bit
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" add build-base multitail tar tree trash-cli unzip cmake jq
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES
|
"$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -50,7 +50,8 @@ installDepend() {
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -n install $DEPENDENCIES
|
"$ESCALATION_TOOL" "$PACKAGER" -n install $DEPENDENCIES
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES
|
printf "%b\n" "${RED}Unsupported package manager ${PACKAGER}${RC}"
|
||||||
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
@ -95,6 +96,8 @@ installAdditionalDepend() {
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -n install $DISTRO_DEPS
|
"$ESCALATION_TOOL" "$PACKAGER" -n install $DISTRO_DEPS
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
printf "%b\n" "${RED}Unsupported package manager ${PACKAGER}${RC}"
|
||||||
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
|
|
||||||
. ../common-script.sh
|
. ../common-script.sh
|
||||||
|
. ../common-service-script.sh
|
||||||
|
|
||||||
cleanup_system() {
|
cleanup_system() {
|
||||||
printf "%b\n" "${YELLOW}Performing system cleanup...${RC}"
|
printf "%b\n" "${YELLOW}Performing system cleanup...${RC}"
|
||||||
|
@ -23,6 +24,9 @@ cleanup_system() {
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -Sc --noconfirm
|
"$ESCALATION_TOOL" "$PACKAGER" -Sc --noconfirm
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -Rns $(pacman -Qtdq) --noconfirm > /dev/null 2>&1
|
"$ESCALATION_TOOL" "$PACKAGER" -Rns $(pacman -Qtdq) --noconfirm > /dev/null 2>&1
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" cache clean
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}. Skipping.${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}. Skipping.${RC}"
|
||||||
;;
|
;;
|
||||||
|
@ -39,7 +43,9 @@ common_cleanup() {
|
||||||
if [ -d /var/log ]; then
|
if [ -d /var/log ]; then
|
||||||
"$ESCALATION_TOOL" find /var/log -type f -name "*.log" -exec truncate -s 0 {} \;
|
"$ESCALATION_TOOL" find /var/log -type f -name "*.log" -exec truncate -s 0 {} \;
|
||||||
fi
|
fi
|
||||||
"$ESCALATION_TOOL" journalctl --vacuum-time=3d
|
if [ "$INIT_MANAGER" = "systemctl" ]; then
|
||||||
|
"$ESCALATION_TOOL" journalctl --vacuum-time=3d
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
clean_data() {
|
clean_data() {
|
||||||
|
|
|
@ -48,6 +48,9 @@ fastUpdate() {
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" ref
|
"$ESCALATION_TOOL" "$PACKAGER" ref
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive dup
|
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive dup
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" update
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -74,6 +77,9 @@ updateSystem() {
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" ref
|
"$ESCALATION_TOOL" "$PACKAGER" ref
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive dup
|
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive dup
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" upgrade
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
|
|
||||||
. ../common-script.sh
|
. ../common-script.sh
|
||||||
|
. ../common-service-script.sh
|
||||||
|
|
||||||
# Function to check Bluez is installed
|
# Function to check Bluez is installed
|
||||||
setupBluetooth() {
|
setupBluetooth() {
|
||||||
|
@ -10,6 +11,9 @@ setupBluetooth() {
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm bluez-utils
|
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm bluez-utils
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" add bluez
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y bluez
|
"$ESCALATION_TOOL" "$PACKAGER" install -y bluez
|
||||||
;;
|
;;
|
||||||
|
@ -18,15 +22,7 @@ setupBluetooth() {
|
||||||
printf "%b\n" "${GREEN}Bluez is already installed.${RC}"
|
printf "%b\n" "${GREEN}Bluez is already installed.${RC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if bluetooth service is running
|
startService bluetooth
|
||||||
if ! systemctl is-active --quiet bluetooth; then
|
|
||||||
printf "%b\n" "${YELLOW}Bluetooth service is not running. Starting it now...${RC}"
|
|
||||||
"$ESCALATION_TOOL" systemctl start bluetooth
|
|
||||||
|
|
||||||
if systemctl is-active --quiet bluetooth; then
|
|
||||||
printf "%b\n" "${GREEN}Bluetooth service started successfully.${RC}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to display the main menu
|
# Function to display the main menu
|
||||||
|
|
|
@ -12,6 +12,7 @@ list_devices() {
|
||||||
printf "\n"
|
printf "\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# shellcheck disable=SC2086
|
||||||
installDependencies() {
|
installDependencies() {
|
||||||
DEPENDENCIES="xz gzip bzip2 jq"
|
DEPENDENCIES="xz gzip bzip2 jq"
|
||||||
if ! command_exists ${DEPENDENCIES}; then
|
if ! command_exists ${DEPENDENCIES}; then
|
||||||
|
@ -23,6 +24,8 @@ installDependencies() {
|
||||||
"${ESCALATION_TOOL}" "${PACKAGER}" install -y ${DEPENDENCIES};;
|
"${ESCALATION_TOOL}" "${PACKAGER}" install -y ${DEPENDENCIES};;
|
||||||
pacman)
|
pacman)
|
||||||
"${ESCALATION_TOOL}" "${PACKAGER}" -S --noconfirm --needed ${DEPENDENCIES};;
|
"${ESCALATION_TOOL}" "${PACKAGER}" -S --noconfirm --needed ${DEPENDENCIES};;
|
||||||
|
apk)
|
||||||
|
"${ESCALATION_TOOL}" "${PACKAGER}" add ${DEPENDENCIES};;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager.${RC}"
|
printf "%b\n" "${RED}Unsupported package manager.${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -19,6 +19,9 @@ if ! command_exists openssl; then
|
||||||
zypper)
|
zypper)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install openssl
|
"$ESCALATION_TOOL" "$PACKAGER" install openssl
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" add openssl
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
|
|
||||||
. ../common-script.sh
|
. ../common-script.sh
|
||||||
|
. ../common-service-script.sh
|
||||||
|
|
||||||
create_file() {
|
create_file() {
|
||||||
printf "%b\n" "Creating script..."
|
printf "%b\n" "Creating script..."
|
||||||
"$ESCALATION_TOOL" tee "/usr/local/bin/numlock" >/dev/null <<'EOF'
|
"$ESCALATION_TOOL" tee "/usr/local/bin/numlock" >/dev/null <<'EOF'
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
for tty in /dev/tty{1..6}
|
for tty in /dev/tty{1..6}
|
||||||
|
@ -13,12 +14,12 @@ do
|
||||||
done
|
done
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
"$ESCALATION_TOOL" chmod +x /usr/local/bin/numlock
|
"$ESCALATION_TOOL" chmod +x /usr/local/bin/numlock
|
||||||
}
|
}
|
||||||
|
|
||||||
create_service() {
|
create_service() {
|
||||||
printf "%b\n" "Creating service..."
|
printf "%b\n" "Creating service..."
|
||||||
"$ESCALATION_TOOL" tee "/etc/systemd/system/numlock.service" >/dev/null <<'EOF'
|
"$ESCALATION_TOOL" tee "/etc/systemd/system/numlock.service" >/dev/null <<'EOF'
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=numlock
|
Description=numlock
|
||||||
|
|
||||||
|
@ -33,23 +34,28 @@ EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
numlockSetup() {
|
numlockSetup() {
|
||||||
if [ ! -f "/usr/local/bin/numlock" ]; then
|
if [ "$INIT_MANAGER" = "rc-service" ]; then
|
||||||
create_file
|
printf "%b\n" "${RED}Unsupported init system.${RC}"
|
||||||
fi
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -f "/etc/systemd/system/numlock.service" ]; then
|
if [ ! -f "/usr/local/bin/numlock" ]; then
|
||||||
create_service
|
create_file
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "%b" "Do you want to enable Numlock on boot? (y/N): "
|
if [ ! -f "/etc/systemd/system/numlock.service" ]; then
|
||||||
read -r confirm
|
create_service
|
||||||
if [ "$confirm" = "y" ] || [ "$confirm" = "Y" ]; then
|
fi
|
||||||
"$ESCALATION_TOOL" systemctl enable numlock.service --quiet
|
|
||||||
printf "%b\n" "Numlock will be enabled on boot"
|
printf "%b" "Do you want to enable Numlock on boot? (y/N): "
|
||||||
else
|
read -r confirm
|
||||||
"$ESCALATION_TOOL" systemctl disable numlock.service --quiet
|
if [ "$confirm" = "y" ] || [ "$confirm" = "Y" ]; then
|
||||||
printf "%b\n" "Numlock will not be enabled on boot"
|
enableService numlock
|
||||||
fi
|
printf "%b\n" "Numlock will be enabled on boot"
|
||||||
|
else
|
||||||
|
disableService numlock
|
||||||
|
printf "%b\n" "Numlock will not be enabled on boot"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
checkEnv
|
checkEnv
|
||||||
|
|
|
@ -11,7 +11,7 @@ installollama() {
|
||||||
else
|
else
|
||||||
printf "%b\n" "${YELLOW}Installing ollama...${RC}"
|
printf "%b\n" "${YELLOW}Installing ollama...${RC}"
|
||||||
curl -fsSL https://ollama.com/install.sh | sh
|
curl -fsSL https://ollama.com/install.sh | sh
|
||||||
"$ESCALATION_TOOL" systemctl start ollama
|
startService ollama
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,9 @@ installAutoCpufreq() {
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm git
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm git
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" add git
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y git
|
"$ESCALATION_TOOL" "$PACKAGER" install -y git
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -11,6 +11,9 @@ install_package() {
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm "$PACKAGE"
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm "$PACKAGE"
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" add "$PACKAGE"
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y "$PACKAGE"
|
"$ESCALATION_TOOL" "$PACKAGER" install -y "$PACKAGE"
|
||||||
;;
|
;;
|
||||||
|
@ -34,23 +37,23 @@ setup_ssh() {
|
||||||
install_package openssh
|
install_package openssh
|
||||||
SSH_SERVICE="sshd"
|
SSH_SERVICE="sshd"
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
install_package openssh
|
||||||
|
SSH_SERVICE="sshd"
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
install_package openssh-server
|
install_package openssh-server
|
||||||
SSH_SERVICE="sshd"
|
SSH_SERVICE="sshd"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Enable and start the appropriate SSH service
|
startAndEnableService "$SSH_SERVICE"
|
||||||
"$ESCALATION_TOOL" systemctl enable "$SSH_SERVICE"
|
|
||||||
"$ESCALATION_TOOL" systemctl start "$SSH_SERVICE"
|
|
||||||
|
|
||||||
# Get the local IP address
|
|
||||||
LOCAL_IP=$(ip -4 addr show | awk '/inet / {print $2}' | tail -n 1)
|
LOCAL_IP=$(ip -4 addr show | awk '/inet / {print $2}' | tail -n 1)
|
||||||
|
|
||||||
printf "%b\n" "${GREEN}Your local IP address is: $LOCAL_IP${RC}"
|
printf "%b\n" "${GREEN}Your local IP address is: $LOCAL_IP${RC}"
|
||||||
|
|
||||||
# Check if SSH is running
|
if isServiceActive "$SSH_SERVICE"; then
|
||||||
if systemctl is-active --quiet "$SSH_SERVICE"; then
|
|
||||||
printf "%b\n" "${GREEN}SSH is up and running.${RC}"
|
printf "%b\n" "${GREEN}SSH is up and running.${RC}"
|
||||||
else
|
else
|
||||||
printf "%b\n" "${RED}Failed to start SSH.${RC}"
|
printf "%b\n" "${RED}Failed to start SSH.${RC}"
|
||||||
|
@ -130,12 +133,11 @@ setup_samba() {
|
||||||
EOL
|
EOL
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Enable and start Samba services
|
for service in smb nmb; do
|
||||||
"$ESCALATION_TOOL" systemctl enable smb nmb
|
startAndEnableService "$service"
|
||||||
"$ESCALATION_TOOL" systemctl start smb nmb
|
done
|
||||||
|
|
||||||
# Check if Samba is running
|
if isServiceActive smb && isServiceActive nmb; then
|
||||||
if systemctl is-active --quiet smb && systemctl is-active --quiet nmb; then
|
|
||||||
printf "%b\n" "${GREEN}Samba is up and running.${RC}"
|
printf "%b\n" "${GREEN}Samba is up and running.${RC}"
|
||||||
printf "%b\n" "${YELLOW}Samba share available at: $SHARED_DIR${RC}"
|
printf "%b\n" "${YELLOW}Samba share available at: $SHARED_DIR${RC}"
|
||||||
else
|
else
|
||||||
|
|
|
@ -12,9 +12,12 @@ install_timeshift() {
|
||||||
pacman)
|
pacman)
|
||||||
"$ESCALATION_TOOL" "${PACKAGER}" -S --noconfirm timeshift
|
"$ESCALATION_TOOL" "${PACKAGER}" -S --noconfirm timeshift
|
||||||
;;
|
;;
|
||||||
*)
|
dnf|zypper|apt-get|nala)
|
||||||
"$ESCALATION_TOOL" "${PACKAGER}" install -y timeshift
|
"$ESCALATION_TOOL" "${PACKAGER}" install -y timeshift
|
||||||
;;
|
;;
|
||||||
|
*)
|
||||||
|
printf "%b\n" "${RED}Unsupported package manager.${RC}"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
printf "%b\n" "${GREEN}Timeshift is already installed.${RC}"
|
printf "%b\n" "${GREEN}Timeshift is already installed.${RC}"
|
||||||
|
|
|
@ -13,6 +13,9 @@ setup_xrandr() {
|
||||||
apt-get|nala)
|
apt-get|nala)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y x11-xserver-utils
|
"$ESCALATION_TOOL" "$PACKAGER" install -y x11-xserver-utils
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" add xrandr
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y xorg-x11-server-utils
|
"$ESCALATION_TOOL" "$PACKAGER" install -y xorg-x11-server-utils
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
|
|
||||||
. ../common-script.sh
|
. ../common-script.sh
|
||||||
|
. ../common-service-script.sh
|
||||||
|
|
||||||
# Function to check if NetworkManager is installed
|
# Function to check if NetworkManager is installed
|
||||||
setupNetworkManager() {
|
setupNetworkManager() {
|
||||||
|
@ -13,6 +14,9 @@ setupNetworkManager() {
|
||||||
dnf)
|
dnf)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y NetworkManager-1
|
"$ESCALATION_TOOL" "$PACKAGER" install -y NetworkManager-1
|
||||||
;;
|
;;
|
||||||
|
apk)
|
||||||
|
"$ESCALATION_TOOL" "$PACKAGER" add networkmanager-wifi iwd
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" install -y network-manager
|
"$ESCALATION_TOOL" "$PACKAGER" install -y network-manager
|
||||||
;;
|
;;
|
||||||
|
@ -22,13 +26,11 @@ setupNetworkManager() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if NetworkManager service is running
|
# Check if NetworkManager service is running
|
||||||
if ! systemctl is-active --quiet NetworkManager; then
|
if ! isServiceActive NetworkManager; then
|
||||||
printf "%b\n" "${YELLOW}NetworkManager service is not running. Starting it now...${RC}"
|
printf "%b\n" "${YELLOW}NetworkManager service is not running. Starting it now...${RC}"
|
||||||
"$ESCALATION_TOOL" systemctl start NetworkManager
|
startService NetworkManager
|
||||||
|
else
|
||||||
if systemctl is-active --quiet NetworkManager; then
|
printf "%b\n" "${GREEN}NetworkManager service started successfully.${RC}"
|
||||||
printf "%b\n" "${GREEN}NetworkManager service started successfully.${RC}"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user