Fixes all BASHISMS

This commit is contained in:
Chris Titus 2024-09-19 13:05:36 -05:00
parent fb883522aa
commit d0b76012df
27 changed files with 149 additions and 147 deletions

View File

@ -31,7 +31,7 @@ install_chrome() {
install_thorium() { install_thorium() {
printf "%b\n" "${YELLOW}Installing Thorium Browser...${RC}" printf "%b\n" "${YELLOW}Installing Thorium Browser...${RC}"
case $PACKAGER in case "$PACKAGER" in
apt-get|nala) apt-get|nala)
"$ESCALATION_TOOL" rm -fv /etc/apt/sources.list.d/thorium.list "$ESCALATION_TOOL" rm -fv /etc/apt/sources.list.d/thorium.list
"$ESCALATION_TOOL" wget --no-hsts -P /etc/apt/sources.list.d/ http://dl.thorium.rocks/debian/dists/stable/thorium.list "$ESCALATION_TOOL" wget --no-hsts -P /etc/apt/sources.list.d/ http://dl.thorium.rocks/debian/dists/stable/thorium.list
@ -79,7 +79,7 @@ install_firefox() {
install_librewolf() { install_librewolf() {
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)
"$ESCALATION_TOOL" "$PACKAGER" update && "$ESCALATION_TOOL" "$PACKAGER" install -y wget gnupg lsb-release apt-transport-https ca-certificates "$ESCALATION_TOOL" "$PACKAGER" update && "$ESCALATION_TOOL" "$PACKAGER" install -y wget gnupg lsb-release apt-transport-https ca-certificates
distro=`if echo " una bookworm vanessa focal jammy bullseye vera uma " | grep -q " $(lsb_release -sc) "; then lsb_release -sc; else echo focal; fi` distro=`if echo " una bookworm vanessa focal jammy bullseye vera uma " | grep -q " $(lsb_release -sc) "; then lsb_release -sc; else echo focal; fi`

View File

@ -16,7 +16,7 @@ setupDWM() {
"$ESCALATION_TOOL" "$PACKAGER" install -y libX11-devel libXinerama-devel libXft-devel imlib2-devel libxcb-devel "$ESCALATION_TOOL" "$PACKAGER" install -y libX11-devel libXinerama-devel libXft-devel imlib2-devel libxcb-devel
;; ;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: $PACKAGER${RC}" printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
exit 1 exit 1
;; ;;
esac esac
@ -188,7 +188,7 @@ setupDisplayManager() {
"$ESCALATION_TOOL" "$PACKAGER" install -y xorg-x11-xinit xorg-x11-server-Xorg "$ESCALATION_TOOL" "$PACKAGER" install -y xorg-x11-xinit xorg-x11-server-Xorg
;; ;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: $PACKAGER${RC}" printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
exit 1 exit 1
;; ;;
esac esac
@ -216,7 +216,7 @@ setupDisplayManager() {
"$ESCALATION_TOOL" "$PACKAGER" install -y "$DM" "$ESCALATION_TOOL" "$PACKAGER" install -y "$DM"
;; ;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: $PACKAGER${RC}" printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
exit 1 exit 1
;; ;;
esac esac

View File

@ -20,7 +20,7 @@ installDepend() {
"$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
;; ;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: $PACKAGER${RC}" # The packages above were grabbed out of the original mybash-setup-script. printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}" # The packages above were grabbed out of the original mybash-setup-script.
exit 1 exit 1
;; ;;
esac esac

View File

@ -29,7 +29,7 @@ installNeovim() {
"$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
;; ;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: $PACKAGER${RC}" # The packages above were grabbed out of the original nvim-setup-script. printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}" # The packages above were grabbed out of the original nvim-setup-script.
exit 1 exit 1
;; ;;
esac esac

View File

@ -23,30 +23,30 @@ setup_flatpak() {
printf "%b\n" "${YELLOW}Installing Flatpak...${RC}" printf "%b\n" "${YELLOW}Installing Flatpak...${RC}"
case "$PACKAGER" in case "$PACKAGER" in
pacman) pacman)
$ESCALATION_TOOL "$PACKAGER" -S --needed --noconfirm flatpak "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm flatpak
;; ;;
apt-get|nala) apt-get|nala)
$ESCALATION_TOOL "$PACKAGER" install -y flatpak "$ESCALATION_TOOL" "$PACKAGER" install -y flatpak
;; ;;
dnf) dnf)
$ESCALATION_TOOL "$PACKAGER" install -y flatpak # Fedora should have flatpak already installed, this is just a failsafe "$ESCALATION_TOOL" "$PACKAGER" install -y flatpak # Fedora should have flatpak already installed, this is just a failsafe
;; ;;
zypper) zypper)
$ESCALATION_TOOL "$PACKAGER" install -y flatpak "$ESCALATION_TOOL" "$PACKAGER" install -y flatpak
;; ;;
yum) yum)
$ESCALATION_TOOL "$PACKAGER" install -y flatpak "$ESCALATION_TOOL" "$PACKAGER" install -y flatpak
;; ;;
xbps-install) xbps-install)
$ESCALATION_TOOL "$PACKAGER" install -S flatpak "$ESCALATION_TOOL" "$PACKAGER" install -S flatpak
;; ;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: $PACKAGER${RC}" printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
exit 1 exit 1
;; ;;
esac esac
printf "%b\n" "Adding Flathub remote..." printf "%b\n" "Adding Flathub remote..."
$ESCALATION_TOOL flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo "$ESCALATION_TOOL" flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
else else
if command -v flatpak >/dev/null 2>&1; then if command -v flatpak >/dev/null 2>&1; then
if ! flatpak remotes | grep -q "flathub"; then if ! flatpak remotes | grep -q "flathub"; then
@ -55,7 +55,7 @@ setup_flatpak() {
case "$add_remote" in case "$add_remote" in
[Yy]*) [Yy]*)
printf "%b\n" "Adding Flathub remote..." printf "%b\n" "Adding Flathub remote..."
$ESCALATION_TOOL flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo "$ESCALATION_TOOL" flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
;; ;;
esac esac
else else
@ -73,14 +73,14 @@ setup_flatpak() {
printf "%b\n" "${YELLOW}Detected GNOME desktop environment. Would you like to install GNOME Software plugin for Flatpak? (y/n)${RC}" printf "%b\n" "${YELLOW}Detected GNOME desktop environment. Would you like to install GNOME Software plugin for Flatpak? (y/n)${RC}"
read install_gnome read install_gnome
if [ "$install_gnome" = "y" ] || [ "$install_gnome" = "Y" ]; then if [ "$install_gnome" = "y" ] || [ "$install_gnome" = "Y" ]; then
$ESCALATION_TOOL "$PACKAGER" install -y gnome-software-plugin-flatpak "$ESCALATION_TOOL" "$PACKAGER" install -y gnome-software-plugin-flatpak
fi fi
# Useful for Debian KDE spin as well # Useful for Debian KDE spin as well
elif [ "$DE" = "KDE" ]; then elif [ "$DE" = "KDE" ]; then
printf "%b\n" "${YELLOW}Detected KDE desktop environment. Would you like to install KDE Plasma Discover backend for Flatpak? (y/n)${RC}" printf "%b\n" "${YELLOW}Detected KDE desktop environment. Would you like to install KDE Plasma Discover backend for Flatpak? (y/n)${RC}"
read install_kde read install_kde
if [ "$install_kde" = "y" ] || [ "$install_kde" = "Y" ]; then if [ "$install_kde" = "y" ] || [ "$install_kde" = "Y" ]; then
$ESCALATION_TOOL "$PACKAGER" install -y plasma-discover-backend-flatpak "$ESCALATION_TOOL" "$PACKAGER" install -y plasma-discover-backend-flatpak
fi fi
fi fi
fi fi

View File

@ -9,10 +9,10 @@ install_package() {
if ! command_exists "$PACKAGE"; then if ! command_exists "$PACKAGE"; then
case "$PACKAGER" in case "$PACKAGER" in
pacman) pacman)
$ESCALATION_TOOL "$PACKAGER" -S --noconfirm "$PACKAGE" "$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm "$PACKAGE"
;; ;;
*) *)
$ESCALATION_TOOL "$PACKAGER" install -y "$PACKAGE" "$ESCALATION_TOOL" "$PACKAGER" install -y "$PACKAGE"
;; ;;
esac esac
else else
@ -41,8 +41,8 @@ setup_ssh() {
esac esac
# Enable and start the appropriate SSH service # Enable and start the appropriate SSH service
$ESCALATION_TOOL systemctl enable "$SSH_SERVICE" "$ESCALATION_TOOL" systemctl enable "$SSH_SERVICE"
$ESCALATION_TOOL systemctl start "$SSH_SERVICE" "$ESCALATION_TOOL" systemctl start "$SSH_SERVICE"
# Get the local IP address # 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)
@ -82,8 +82,8 @@ setup_samba() {
SHARED_DIR=${SHARED_DIR:-/srv/samba/share} SHARED_DIR=${SHARED_DIR:-/srv/samba/share}
# Create the shared directory if it doesn't exist # Create the shared directory if it doesn't exist
$ESCALATION_TOOL mkdir -p "$SHARED_DIR" "$ESCALATION_TOOL" mkdir -p "$SHARED_DIR"
$ESCALATION_TOOL chmod -R 0777 "$SHARED_DIR" "$ESCALATION_TOOL" chmod -R 0777 "$SHARED_DIR"
# Add a new Samba user # Add a new Samba user
printf "Enter Samba username: " printf "Enter Samba username: "
@ -109,10 +109,10 @@ setup_samba() {
done done
# Add the user and set the password # Add the user and set the password
$ESCALATION_TOOL smbpasswd -a "$SAMBA_USER" "$ESCALATION_TOOL" smbpasswd -a "$SAMBA_USER"
# Configure Samba settings # Configure Samba settings
$ESCALATION_TOOL sh -c "cat > $SAMBA_CONFIG" <<EOL "$ESCALATION_TOOL" sh -c "cat > $SAMBA_CONFIG" <<EOL
[global] [global]
workgroup = WORKGROUP workgroup = WORKGROUP
server string = Samba Server server string = Samba Server
@ -130,8 +130,8 @@ EOL
fi fi
# Enable and start Samba services # Enable and start Samba services
$ESCALATION_TOOL systemctl enable smb nmb "$ESCALATION_TOOL" systemctl enable smb nmb
$ESCALATION_TOOL systemctl start smb nmb "$ESCALATION_TOOL" systemctl start smb nmb
# Check if Samba is running # Check if Samba is running
if systemctl is-active --quiet smb && systemctl is-active --quiet nmb; then if systemctl is-active --quiet smb && systemctl is-active --quiet nmb; then
@ -147,9 +147,9 @@ configure_firewall() {
printf "%b\n" "${BLUE}Configuring firewall...${RC}" printf "%b\n" "${BLUE}Configuring firewall...${RC}"
if command_exists ufw; then if command_exists ufw; then
$ESCALATION_TOOL ufw allow OpenSSH "$ESCALATION_TOOL" ufw allow OpenSSH
$ESCALATION_TOOL ufw allow Samba "$ESCALATION_TOOL" ufw allow Samba
$ESCALATION_TOOL ufw enable "$ESCALATION_TOOL" ufw enable
printf "%b\n" "${GREEN}Firewall configured for SSH and Samba.${RC}" printf "%b\n" "${GREEN}Firewall configured for SSH and Samba.${RC}"
else else
printf "%b\n" "${YELLOW}UFW is not installed. Skipping firewall configuration.${RC}" printf "%b\n" "${YELLOW}UFW is not installed. Skipping firewall configuration.${RC}"

View File

@ -22,19 +22,19 @@ choose_installation() {
install_docker() { install_docker() {
printf "%b\n" "${YELLOW}Installing Docker...${RC}" printf "%b\n" "${YELLOW}Installing Docker...${RC}"
case $PACKAGER in case "$PACKAGER" in
apt-get | yum) apt-get | yum)
curl -fsSL https://get.docker.com | sh curl -fsSL https://get.docker.com | sh
;; ;;
zypper) zypper)
$ESCALATION_TOOL ${PACKAGER} --non-interactive install docker "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install docker
$ESCALATION_TOOL systemctl enable docker "$ESCALATION_TOOL" systemctl enable docker
$ESCALATION_TOOL systemctl start 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 enable docker
$ESCALATION_TOOL systemctl start docker "$ESCALATION_TOOL" systemctl start docker
;; ;;
*) *)
printf "${RED}Unsupported package manager. Please install Docker manually.${RC}\n" printf "${RED}Unsupported package manager. Please install Docker manually.${RC}\n"
@ -45,16 +45,16 @@ install_docker() {
install_docker_compose() { install_docker_compose() {
printf "%b\n" "${YELLOW}Installing Docker Compose...${RC}" printf "%b\n" "${YELLOW}Installing Docker Compose...${RC}"
case $PACKAGER in case "$PACKAGER" in
apt-get | yum) apt-get | yum)
$ESCALATION_TOOL ${PACKAGER} update "$ESCALATION_TOOL" "$PACKAGER" update
$ESCALATION_TOOL ${PACKAGER} install -y docker-compose-plugin "$ESCALATION_TOOL" "$PACKAGER" install -y docker-compose-plugin
;; ;;
zypper) zypper)
$ESCALATION_TOOL ${PACKAGER} --non-interactive install docker-compose "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install docker-compose
;; ;;
pacman) pacman)
$ESCALATION_TOOL ${PACKAGER} -S --noconfirm docker-compose "$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm docker-compose
;; ;;
*) *)
printf "${RED}Unsupported package manager. Please install Docker Compose manually.${RC}\n" printf "${RED}Unsupported package manager. Please install Docker Compose manually.${RC}\n"

View File

@ -42,7 +42,7 @@ create_mount_point() {
read -r mount_point read -r mount_point
if [ ! -d "$mount_point" ]; then if [ ! -d "$mount_point" ]; then
printf "%b\n" "${YELLOW}Mount point doesn't exist. Creating it..${RC}." printf "%b\n" "${YELLOW}Mount point doesn't exist. Creating it..${RC}."
$ESCALATION_TOOL mkdir -p "$mount_point" "$ESCALATION_TOOL" mkdir -p "$mount_point"
else else
printf "%b\n" "${RED}Mount point already exists.${RC}" printf "%b\n" "${RED}Mount point already exists.${RC}"
fi fi
@ -51,15 +51,15 @@ create_mount_point() {
# Function to update /etc/fstab with a comment on the first line and the actual entry on the second line # Function to update /etc/fstab with a comment on the first line and the actual entry on the second line
update_fstab() { update_fstab() {
printf "%b\n" "${YELLOW}Adding entry to /etc/fstab...${RC}" printf "%b\n" "${YELLOW}Adding entry to /etc/fstab...${RC}"
$ESCALATION_TOOL cp /etc/fstab /etc/fstab.bak # Backup fstab "$ESCALATION_TOOL" cp /etc/fstab /etc/fstab.bak # Backup fstab
# Prepare the comment and the fstab entry # Prepare the comment and the fstab entry
comment="# Mount for /dev/$NAME" comment="# Mount for /dev/$NAME"
fstab_entry="UUID=$UUID $mount_point $FSTYPE defaults 0 2" fstab_entry="UUID=$UUID $mount_point $FSTYPE defaults 0 2"
# Append the comment and the entry to /etc/fstab # Append the comment and the entry to /etc/fstab
printf "%b\n" "$comment" | $ESCALATION_TOOL tee -a /etc/fstab > /dev/null printf "%b\n" "$comment" | "$ESCALATION_TOOL" tee -a /etc/fstab > /dev/null
printf "%b\n" "$fstab_entry" | $ESCALATION_TOOL tee -a /etc/fstab > /dev/null printf "%b\n" "$fstab_entry" | "$ESCALATION_TOOL" tee -a /etc/fstab > /dev/null
printf "%b\n" "" | "$ESCALATION_TOOL" tee -a /etc/fstab > /dev/null printf "%b\n" "" | "$ESCALATION_TOOL" tee -a /etc/fstab > /dev/null
printf "%b\n" "Entry added to /etc/fstab:" printf "%b\n" "Entry added to /etc/fstab:"
@ -71,7 +71,7 @@ update_fstab() {
# Function to mount the drive # Function to mount the drive
mount_drive() { mount_drive() {
printf "%b\n" "Mounting the drive..." printf "%b\n" "Mounting the drive..."
$ESCALATION_TOOL mount -a "$ESCALATION_TOOL" mount -a
if mount | grep "$mount_point" > /dev/null; then if mount | grep "$mount_point" > /dev/null; then
printf "%b\n" "${GREEN}Drive mounted successfully at $mount_point${RC}." printf "%b\n" "${GREEN}Drive mounted successfully at $mount_point${RC}."
else else

View File

@ -7,8 +7,8 @@ installDepend() {
pacman) pacman)
if ! command_exists paru; then if ! command_exists paru; then
printf "%b\n" "${YELLOW}Installing paru as AUR helper...${RC}" printf "%b\n" "${YELLOW}Installing paru as AUR helper...${RC}"
$ESCALATION_TOOL "$PACKAGER" -S --needed --noconfirm base-devel "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm base-devel
cd /opt && $ESCALATION_TOOL git clone https://aur.archlinux.org/paru.git && $ESCALATION_TOOL chown -R "$USER": ./paru cd /opt && "$ESCALATION_TOOL" git clone https://aur.archlinux.org/paru.git && "$ESCALATION_TOOL" chown -R "$USER": ./paru
cd paru && makepkg --noconfirm -si cd paru && makepkg --noconfirm -si
printf "%b\n" "${GREEN}Paru installed${RC}" printf "%b\n" "${GREEN}Paru installed${RC}"
else else
@ -16,7 +16,7 @@ installDepend() {
fi fi
;; ;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: $PACKAGER${RC}" printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
;; ;;
esac esac
} }

View File

@ -7,8 +7,8 @@ installDepend() {
pacman) pacman)
if ! command_exists yay; then if ! command_exists yay; then
printf "%b\n" "${YELLOW}Installing yay as AUR helper...${RC}" printf "%b\n" "${YELLOW}Installing yay as AUR helper...${RC}"
$ESCALATION_TOOL "$PACKAGER" -S --needed --noconfirm base-devel "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm base-devel
cd /opt && $ESCALATION_TOOL git clone https://aur.archlinux.org/yay-bin.git && $ESCALATION_TOOL chown -R "$USER": ./yay-bin cd /opt && "$ESCALATION_TOOL" git clone https://aur.archlinux.org/yay-bin.git && "$ESCALATION_TOOL" chown -R "$USER": ./yay-bin
cd yay-bin && makepkg --noconfirm -si cd yay-bin && makepkg --noconfirm -si
printf "%b\n" "${GREEN}Yay installed${RC}" printf "%b\n" "${GREEN}Yay installed${RC}"
else else
@ -16,7 +16,7 @@ installDepend() {
fi fi
;; ;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: $PACKAGER${RC}" printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
;; ;;
esac esac
} }

View File

@ -3,13 +3,13 @@
. ../../common-script.sh . ../../common-script.sh
configureDNF() { configureDNF() {
case $PACKAGER in case "$PACKAGER" in
dnf) dnf)
printf "%b\n" "${YELLOW}Configuring DNF...${RC}" printf "%b\n" "${YELLOW}Configuring DNF...${RC}"
$ESCALATION_TOOL sed -i '/^max_parallel_downloads=/c\max_parallel_downloads=10' /etc/dnf/dnf.conf || echo 'max_parallel_downloads=10' >> /etc/dnf/dnf.conf "$ESCALATION_TOOL" sed -i '/^max_parallel_downloads=/c\max_parallel_downloads=10' /etc/dnf/dnf.conf || echo 'max_parallel_downloads=10' >> /etc/dnf/dnf.conf
echo "fastestmirror=True" | $ESCALATION_TOOL tee -a /etc/dnf/dnf.conf > /dev/null echo "fastestmirror=True" | "$ESCALATION_TOOL" tee -a /etc/dnf/dnf.conf > /dev/null
echo "defaultyes=True" | $ESCALATION_TOOL tee -a /etc/dnf/dnf.conf > /dev/null echo "defaultyes=True" | "$ESCALATION_TOOL" tee -a /etc/dnf/dnf.conf > /dev/null
$ESCALATION_TOOL "$PACKAGER" -y install dnf-plugins-core "$ESCALATION_TOOL" "$PACKAGER" -y install dnf-plugins-core
printf "%b\n" "${GREEN}DNF Configured Succesfully...${RC}" printf "%b\n" "${GREEN}DNF Configured Succesfully...${RC}"
;; ;;
*) *)

View File

@ -3,13 +3,13 @@
. ../../common-script.sh . ../../common-script.sh
multimedia() { multimedia() {
case $PACKAGER in case "$PACKAGER" in
dnf) dnf)
if [ -e /etc/yum.repos.d/rpmfusion-free.repo ] && [ -e /etc/yum.repos.d/rpmfusion-nonfree.repo ]; then if [ -e /etc/yum.repos.d/rpmfusion-free.repo ] && [ -e /etc/yum.repos.d/rpmfusion-nonfree.repo ]; then
printf "%b\n" "${YELLOW}Installing Multimedia Codecs...${RC}" printf "%b\n" "${YELLOW}Installing Multimedia Codecs...${RC}"
$ESCALATION_TOOL "$PACKAGER" swap ffmpeg-free ffmpeg --allowerasing -y "$ESCALATION_TOOL" "$PACKAGER" swap ffmpeg-free ffmpeg --allowerasing -y
$ESCALATION_TOOL "$PACKAGER" update @multimedia --setopt="install_weak_deps=False" --exclude=PackageKit-gstreamer-plugin -y "$ESCALATION_TOOL" "$PACKAGER" update @multimedia --setopt="install_weak_deps=False" --exclude=PackageKit-gstreamer-plugin -y
$ESCALATION_TOOL "$PACKAGER" update @sound-and-video -y "$ESCALATION_TOOL" "$PACKAGER" update @sound-and-video -y
printf "%b\n" "${GREEN}Multimedia Codecs Installed...${RC}" printf "%b\n" "${GREEN}Multimedia Codecs Installed...${RC}"
else else
printf "%b\n" "${RED}RPM Fusion repositories not found. Please set up RPM Fusion first!${RC}" printf "%b\n" "${RED}RPM Fusion repositories not found. Please set up RPM Fusion first!${RC}"

View File

@ -18,10 +18,10 @@ checkRepo() {
printf "%b\n" "${YELLOW}Nvidia non-free repository is not enabled. Enabling now...${RC}" printf "%b\n" "${YELLOW}Nvidia non-free repository is not enabled. Enabling now...${RC}"
# Enable the repository # Enable the repository
$ESCALATION_TOOL dnf config-manager --set-enabled "$REPO_ID" "$ESCALATION_TOOL" dnf config-manager --set-enabled "$REPO_ID"
# Refreshing repository list # Refreshing repository list
$ESCALATION_TOOL dnf makecache "$ESCALATION_TOOL" dnf makecache
# Verify if the repository is enabled # Verify if the repository is enabled
if [ $(dnf repolist enabled 2>/dev/null | grep "$REPO_ID" | wc -l) -gt 0 ]; then if [ $(dnf repolist enabled 2>/dev/null | grep "$REPO_ID" | wc -l) -gt 0 ]; then
@ -49,7 +49,7 @@ installDriver() {
fi fi
# NOTE:: Installing graphics driver. # NOTE:: Installing graphics driver.
$ESCALATION_TOOL dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda -y "$ESCALATION_TOOL" dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda -y
printf "%b\n" "${YELLOW}Building the drivers may take upto 5 minutes. Please don't kill the script!\n If the build failed try running the script again, select \"Remove Nvidia Drivers\" and reboot the system, then try installing drivers again.${RC}" printf "%b\n" "${YELLOW}Building the drivers may take upto 5 minutes. Please don't kill the script!\n If the build failed try running the script again, select \"Remove Nvidia Drivers\" and reboot the system, then try installing drivers again.${RC}"
for i in $(seq 1 5); do for i in $(seq 1 5); do

View File

@ -4,10 +4,10 @@
# Install virtualization tools to enable virtual machines # Install virtualization tools to enable virtual machines
configureVirtualization() { configureVirtualization() {
case $PACKAGER in case "$PACKAGER" in
dnf) dnf)
printf "%b\n" ${YELLOW}"Installing virtualization tools...${RC}" printf "%b\n" ${YELLOW}"Installing virtualization tools...${RC}"
$ESCALATION_TOOL "$PACKAGER" install -y @virtualization "$ESCALATION_TOOL" "$PACKAGER" install -y @virtualization
printf "%b\n" "${GREEN}Installed virtualization tools...${RC}" printf "%b\n" "${GREEN}Installed virtualization tools...${RC}"
;; ;;
*) *)

View File

@ -26,7 +26,7 @@ cleanup_system() {
"$ESCALATION_TOOL" "$PACKAGER" -Rns "$(pacman -Qtdq)" --noconfirm "$ESCALATION_TOOL" "$PACKAGER" -Rns "$(pacman -Qtdq)" --noconfirm
;; ;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: $PACKAGER${RC}" printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
return 1 return 1
;; ;;
esac esac

View File

@ -56,7 +56,7 @@ fastUpdate() {
"$ESCALATION_TOOL" "$PACKAGER" -Syu- "$ESCALATION_TOOL" "$PACKAGER" -Syu-
;; ;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: $PACKAGER${RC}" printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
exit 1 exit 1
;; ;;
esac esac
@ -85,7 +85,7 @@ updateSystem() {
"$ESCALATION_TOOL" "$PACKAGER" -Syu "$ESCALATION_TOOL" "$PACKAGER" -Syu
;; ;;
*) *)
printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}${RC}" printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}"
exit 1 exit 1
;; ;;
esac esac

View File

@ -44,9 +44,9 @@ configure_lightdm() {
printf "Enter username for LightDM autologin: " printf "Enter username for LightDM autologin: "
read -r user read -r user
$ESCALATION_TOOL "printf '[Seat:*]' > /etc/lightdm/lightdm.conf.d/50-autologin.conf" "$ESCALATION_TOOL" "printf '[Seat:*]' > /etc/lightdm/lightdm.conf.d/50-autologin.conf"
$ESCALATION_TOOL "printf 'autologin-user=$user' >> /etc/lightdm/lightdm.conf.d/50-autologin.conf" "$ESCALATION_TOOL" "printf 'autologin-user=$user' >> /etc/lightdm/lightdm.conf.d/50-autologin.conf"
$ESCALATION_TOOL "printf 'autologin-user-timeout=0' >> /etc/lightdm/lightdm.conf.d/50-autologin.conf" "$ESCALATION_TOOL" "printf 'autologin-user-timeout=0' >> /etc/lightdm/lightdm.conf.d/50-autologin.conf"
printf "LightDM has been configured for autologin.\n" printf "LightDM has been configured for autologin.\n"
} }
@ -54,7 +54,7 @@ configure_lightdm() {
# Function to remove LightDM autologin # Function to remove LightDM autologin
remove_lightdm_autologin() { remove_lightdm_autologin() {
printf "Removing LightDM autologin configuration...\n" printf "Removing LightDM autologin configuration...\n"
$ESCALATION_TOOL rm -f /etc/lightdm/lightdm.conf.d/50-autologin.conf "$ESCALATION_TOOL" rm -f /etc/lightdm/lightdm.conf.d/50-autologin.conf
printf "LightDM autologin configuration has been removed.\n" printf "LightDM autologin configuration has been removed.\n"
} }
@ -65,9 +65,9 @@ configure_gdm() {
printf "Enter username for GDM autologin: " printf "Enter username for GDM autologin: "
read -r user read -r user
$ESCALATION_TOOL "printf '[daemon]' > /etc/gdm/custom.conf" "$ESCALATION_TOOL" "printf '[daemon]' > /etc/gdm/custom.conf"
$ESCALATION_TOOL "printf 'AutomaticLoginEnable = true' >> /etc/gdm/custom.conf" "$ESCALATION_TOOL" "printf 'AutomaticLoginEnable = true' >> /etc/gdm/custom.conf"
$ESCALATION_TOOL "printf 'AutomaticLogin = $user' >> /etc/gdm/custom.conf" "$ESCALATION_TOOL" "printf 'AutomaticLogin = $user' >> /etc/gdm/custom.conf"
printf "GDM has been configured for autologin.\n" printf "GDM has been configured for autologin.\n"
} }
@ -75,8 +75,8 @@ configure_gdm() {
# Function to remove GDM autologin # Function to remove GDM autologin
remove_gdm_autologin() { remove_gdm_autologin() {
printf "Removing GDM autologin configuration...\n" printf "Removing GDM autologin configuration...\n"
$ESCALATION_TOOL sed -i '/AutomaticLoginEnable/d' /etc/gdm/custom.conf "$ESCALATION_TOOL" sed -i '/AutomaticLoginEnable/d' /etc/gdm/custom.conf
$ESCALATION_TOOL sed -i '/AutomaticLogin/d' /etc/gdm/custom.conf "$ESCALATION_TOOL" sed -i '/AutomaticLogin/d' /etc/gdm/custom.conf
printf "GDM autologin configuration has been removed.\n" printf "GDM autologin configuration has been removed.\n"
} }
@ -88,9 +88,9 @@ configure_sddm() {
read -r user read -r user
list_sessions # Show session options list_sessions # Show session options
$ESCALATION_TOOL "printf '[Autologin]' > /etc/sddm.conf" "$ESCALATION_TOOL" "printf '[Autologin]' > /etc/sddm.conf"
$ESCALATION_TOOL "printf 'User=$user' >> /etc/sddm.conf" "$ESCALATION_TOOL" "printf 'User=$user' >> /etc/sddm.conf"
$ESCALATION_TOOL "printf 'Session=$session' >> /etc/sddm.conf" "$ESCALATION_TOOL" "printf 'Session=$session' >> /etc/sddm.conf"
printf "SDDM has been configured for autologin.\n" printf "SDDM has been configured for autologin.\n"
} }
@ -98,7 +98,7 @@ configure_sddm() {
# Function to remove SDDM autologin # Function to remove SDDM autologin
remove_sddm_autologin() { remove_sddm_autologin() {
printf "Removing SDDM autologin configuration...\n" printf "Removing SDDM autologin configuration...\n"
$ESCALATION_TOOL sed -i '/\[Autologin\]/,+2d' /etc/sddm.conf "$ESCALATION_TOOL" sed -i '/\[Autologin\]/,+2d' /etc/sddm.conf
printf "SDDM autologin configuration has been removed.\n" printf "SDDM autologin configuration has been removed.\n"
} }
@ -110,8 +110,8 @@ configure_lxdm() {
read -r user read -r user
list_sessions # Show session options list_sessions # Show session options
$ESCALATION_TOOL sed -i "s/^#.*autologin=.*$/autologin=${user}/" /etc/lxdm/lxdm.conf "$ESCALATION_TOOL" sed -i "s/^#.*autologin=.*$/autologin=${user}/" /etc/lxdm/lxdm.conf
$ESCALATION_TOOL sed -i "s|^#.*session=.*$|session=/usr/bin/${session}|; s|^session=.*$|session=/usr/bin/${session}|" /etc/lxdm/lxdm.conf "$ESCALATION_TOOL" sed -i "s|^#.*session=.*$|session=/usr/bin/${session}|; s|^session=.*$|session=/usr/bin/${session}|" /etc/lxdm/lxdm.conf
printf "LXDM has been configured for autologin.\n" printf "LXDM has been configured for autologin.\n"
} }
@ -119,8 +119,8 @@ configure_lxdm() {
# Function to remove LXDM autologin # Function to remove LXDM autologin
remove_lxdm_autologin() { remove_lxdm_autologin() {
printf "Removing LXDM autologin configuration...\n" printf "Removing LXDM autologin configuration...\n"
$ESCALATION_TOOL sed -i "s/^autologin=.*$/#autologin=/" /etc/lxdm/lxdm.conf "$ESCALATION_TOOL" sed -i "s/^autologin=.*$/#autologin=/" /etc/lxdm/lxdm.conf
$ESCALATION_TOOL sed -i "s/^session=.*$/#session=/" /etc/lxdm/lxdm.conf "$ESCALATION_TOOL" sed -i "s/^session=.*$/#session=/" /etc/lxdm/lxdm.conf
printf "LXDM autologin configuration has been removed.\n" printf "LXDM autologin configuration has been removed.\n"
} }

View File

@ -13,7 +13,7 @@ usage() {
list_devices() { list_devices() {
printf "%b\n" "${YELLOW} Available devices and partitions: ${RC}" printf "%b\n" "${YELLOW} Available devices and partitions: ${RC}"
printf "\n" printf "\n"
$ESCALATION_TOOL lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL "$ESCALATION_TOOL" lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
printf "\n" printf "\n"
} }
@ -164,13 +164,13 @@ write_iso(){
# Display progress and create the bootable USB drive # Display progress and create the bootable USB drive
printf "%b\n" "${YELLOW}Creating bootable USB drive...${RC}" printf "%b\n" "${YELLOW}Creating bootable USB drive...${RC}"
if ! $ESCALATION_TOOL dd if="$ISO_PATH" of="$USB_DEVICE" bs=4M status=progress oflag=sync; then if ! "$ESCALATION_TOOL" dd if="$ISO_PATH" of="$USB_DEVICE" bs=4M status=progress oflag=sync; then
printf "%b\n" "${RED}Failed to create bootable USB drive${RC}" printf "%b\n" "${RED}Failed to create bootable USB drive${RC}"
exit 1 exit 1
fi fi
# Sync to ensure all data is written # Sync to ensure all data is written
if ! $ESCALATION_TOOL sync; then if ! "$ESCALATION_TOOL" sync; then
printf "%b\n" "${RED}Failed to sync data${RC}" printf "%b\n" "${RED}Failed to sync data${RC}"
exit 1 exit 1
fi fi
@ -179,10 +179,10 @@ write_iso(){
# Eject the USB device # Eject the USB device
printf "%b\n" "${YELLOW}Ejecting ${USB_DEVICE}...${RC}" printf "%b\n" "${YELLOW}Ejecting ${USB_DEVICE}...${RC}"
if ! $ESCALATION_TOOL umount "${USB_DEVICE}"* 2>/dev/null; then if ! "$ESCALATION_TOOL" umount "${USB_DEVICE}"* 2>/dev/null; then
printf "%b\n" "${RED}Failed to unmount ${USB_DEVICE}${RC}" printf "%b\n" "${RED}Failed to unmount ${USB_DEVICE}${RC}"
fi fi
if ! $ESCALATION_TOOL eject "$USB_DEVICE"; then if ! "$ESCALATION_TOOL" eject "$USB_DEVICE"; then
printf "%b\n" "${RED}Failed to eject ${USB_DEVICE}${RC}" printf "%b\n" "${RED}Failed to eject ${USB_DEVICE}${RC}"
fi fi

View File

@ -6,18 +6,18 @@ printf "%b\n" "${YELLOW}Ensuring OpenSSL is installed...${RC}"
# Install OpenSSL # Install OpenSSL
if ! command_exists openssl; then if ! command_exists openssl; then
case $PACKAGER in case "$PACKAGER" in
pacman) pacman)
$ESCALATION_TOOL ${PACKAGER} -Syu --noconfirm openssl "$ESCALATION_TOOL" "$PACKAGER" -Syu --noconfirm openssl
;; ;;
apt-get) apt-get)
$ESCALATION_TOOL ${PACKAGER} update && $ESCALATION_TOOL ${PACKAGER} install -y openssl "$ESCALATION_TOOL" "$PACKAGER" update && "$ESCALATION_TOOL" "$PACKAGER" install -y openssl
;; ;;
dnf) dnf)
$ESCALATION_TOOL ${PACKAGER} install -y openssl "$ESCALATION_TOOL" "$PACKAGER" install -y openssl
;; ;;
zypper) zypper)
$ESCALATION_TOOL ${PACKAGER} install openssl "$ESCALATION_TOOL" "$PACKAGER" install openssl
;; ;;
*) *)
printf "%b\n" "${RED}Your Linux distribution is not supported by this script.${RC}" printf "%b\n" "${RED}Your Linux distribution is not supported by this script.${RC}"

View File

@ -15,12 +15,12 @@ installAutoCpufreq() {
# Install git if not already installed # Install git if not already installed
if ! command_exists git; then if ! command_exists git; then
printf "%b\n" "${YELLOW}git not found. Installing git...${RC}" printf "%b\n" "${YELLOW}git not found. Installing git...${RC}"
case ${PACKAGER} in case "$PACKAGER" in
pacman) pacman)
$ESCALATION_TOOL ${PACKAGER} -S --needed --noconfirm git "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm git
;; ;;
*) *)
$ESCALATION_TOOL ${PACKAGER} install -y git "$ESCALATION_TOOL" "$PACKAGER" install -y git
;; ;;
esac esac
fi fi
@ -31,11 +31,11 @@ installAutoCpufreq() {
git clone https://github.com/AdnanHodzic/auto-cpufreq.git git clone https://github.com/AdnanHodzic/auto-cpufreq.git
fi fi
case ${PACKAGER} in case "$PACKAGER" in
*) *)
cd auto-cpufreq cd auto-cpufreq
printf "%b\n" "${YELLOW}Running auto-cpufreq installer...${RC}" printf "%b\n" "${YELLOW}Running auto-cpufreq installer...${RC}"
$ESCALATION_TOOL ./auto-cpufreq-installer "$ESCALATION_TOOL" ./auto-cpufreq-installer
;; ;;
esac esac
cd .. cd ..
@ -49,10 +49,10 @@ configureAutoCpufreq() {
# Check if the system has a battery to determine if it's a laptop # Check if the system has a battery to determine if it's a laptop
if [ -d /sys/class/power_supply/BAT0 ]; then if [ -d /sys/class/power_supply/BAT0 ]; then
printf "%b\n" "${GREEN}System detected as laptop. Updating auto-cpufreq for laptop...${RC}" printf "%b\n" "${GREEN}System detected as laptop. Updating auto-cpufreq for laptop...${RC}"
$ESCALATION_TOOL auto-cpufreq --force powersave "$ESCALATION_TOOL" auto-cpufreq --force powersave
else else
printf "%b\n" "${GREEN}System detected as desktop. Updating auto-cpufreq for desktop...${RC}" printf "%b\n" "${GREEN}System detected as desktop. Updating auto-cpufreq for desktop...${RC}"
$ESCALATION_TOOL auto-cpufreq --force performance "$ESCALATION_TOOL" auto-cpufreq --force performance
fi fi
else else
printf "%b\n" "${RED}auto-cpufreq is not installed, skipping configuration.${RC}" printf "%b\n" "${RED}auto-cpufreq is not installed, skipping configuration.${RC}"
@ -64,7 +64,7 @@ removeAutoCpufreqTweak() {
if command_exists auto-cpufreq; then if command_exists auto-cpufreq; then
printf "%b\n" "${YELLOW}Resetting auto-cpufreq configuration...${RC}" printf "%b\n" "${YELLOW}Resetting auto-cpufreq configuration...${RC}"
$ESCALATION_TOOL auto-cpufreq --force reset "$ESCALATION_TOOL" auto-cpufreq --force reset
else else
printf "%b\n" "${RED}auto-cpufreq is not installed, skipping removal.${RC}" printf "%b\n" "${RED}auto-cpufreq is not installed, skipping removal.${RC}"
fi fi

View File

@ -92,11 +92,11 @@ add_service() {
printf "\n" printf "\n"
printf "[Install]\n" printf "[Install]\n"
printf "WantedBy=multi-user.target\n" printf "WantedBy=multi-user.target\n"
} | $ESCALATION_TOOL tee "$SERVICE_FILE" > /dev/null } | "$ESCALATION_TOOL" tee "$SERVICE_FILE" > /dev/null
# Set permissions and reload systemd # Set permissions and reload systemd
$ESCALATION_TOOL chmod 644 "$SERVICE_FILE" "$ESCALATION_TOOL" chmod 644 "$SERVICE_FILE"
$ESCALATION_TOOL systemctl daemon-reload "$ESCALATION_TOOL" systemctl daemon-reload
printf "Service $SERVICE_NAME has been created and is ready to be started.\n" printf "Service $SERVICE_NAME has been created and is ready to be started.\n"
# Optionally, enable and start the service # Optionally, enable and start the service
@ -121,12 +121,12 @@ remove_service() {
if [ -f "$SERVICE_FILE" ]; then if [ -f "$SERVICE_FILE" ]; then
printf "Stopping and disabling the service...\n" printf "Stopping and disabling the service...\n"
$ESCALATION_TOOL systemctl stop "$SERVICE_NAME" "$ESCALATION_TOOL" systemctl stop "$SERVICE_NAME"
$ESCALATION_TOOL systemctl disable "$SERVICE_NAME" "$ESCALATION_TOOL" systemctl disable "$SERVICE_NAME"
printf "Removing the service file...\n" printf "Removing the service file...\n"
$ESCALATION_TOOL rm -f "$SERVICE_FILE" "$ESCALATION_TOOL" rm -f "$SERVICE_FILE"
$ESCALATION_TOOL systemctl daemon-reload "$ESCALATION_TOOL" systemctl daemon-reload
printf "Service $SERVICE_NAME has been removed.\n" printf "Service $SERVICE_NAME has been removed.\n"
else else
printf "Service $SERVICE_NAME does not exist.\n" printf "Service $SERVICE_NAME does not exist.\n"
@ -139,7 +139,7 @@ start_service() {
printf "Enter the name of the service to start (e.g., my_service):\n" printf "Enter the name of the service to start (e.g., my_service):\n"
read -r SERVICE_NAME read -r SERVICE_NAME
if $ESCALATION_TOOL systemctl start "$SERVICE_NAME"; then if "$ESCALATION_TOOL" systemctl start "$SERVICE_NAME"; then
printf "Service $SERVICE_NAME has been started.\n" printf "Service $SERVICE_NAME has been started.\n"
else else
printf "Failed to start service: $SERVICE_NAME.\n" printf "Failed to start service: $SERVICE_NAME.\n"
@ -152,7 +152,7 @@ stop_service() {
printf "Enter the name of the service to stop (e.g., my_service):\n" printf "Enter the name of the service to stop (e.g., my_service):\n"
read -r SERVICE_NAME read -r SERVICE_NAME
if $ESCALATION_TOOL systemctl stop "$SERVICE_NAME"; then if "$ESCALATION_TOOL" systemctl stop "$SERVICE_NAME"; then
printf "Service $SERVICE_NAME has been stopped.\n" printf "Service $SERVICE_NAME has been stopped.\n"
else else
printf "Failed to stop service: $SERVICE_NAME.\n" printf "Failed to stop service: $SERVICE_NAME.\n"
@ -165,7 +165,7 @@ enable_service() {
printf "Enter the name of the service to enable (e.g., my_service):\n" printf "Enter the name of the service to enable (e.g., my_service):\n"
read -r SERVICE_NAME read -r SERVICE_NAME
if $ESCALATION_TOOL systemctl enable "$SERVICE_NAME"; then if "$ESCALATION_TOOL" systemctl enable "$SERVICE_NAME"; then
printf "Service $SERVICE_NAME has been enabled.\n" printf "Service $SERVICE_NAME has been enabled.\n"
else else
printf "Failed to enable service: $SERVICE_NAME.\n" printf "Failed to enable service: $SERVICE_NAME.\n"
@ -178,7 +178,7 @@ disable_service() {
printf "Enter the name of the service to disable (e.g., my_service):\n" printf "Enter the name of the service to disable (e.g., my_service):\n"
read -r SERVICE_NAME read -r SERVICE_NAME
if $ESCALATION_TOOL systemctl disable "$SERVICE_NAME"; then if "$ESCALATION_TOOL" systemctl disable "$SERVICE_NAME"; then
printf "Service $SERVICE_NAME has been enabled.\n" printf "Service $SERVICE_NAME has been enabled.\n"
else else
printf "Failed to enable service: $SERVICE_NAME.\n" printf "Failed to enable service: $SERVICE_NAME.\n"
@ -228,8 +228,8 @@ create_service_from_external() {
"$ESCALATION_TOOL" cp "$SERVICE_FILE" "$SYSTEMD_SERVICE_FILE" "$ESCALATION_TOOL" cp "$SERVICE_FILE" "$SYSTEMD_SERVICE_FILE"
# Set permissions and reload systemd # Set permissions and reload systemd
$ESCALATION_TOOL chmod 644 "$SYSTEMD_SERVICE_FILE" "$ESCALATION_TOOL" chmod 644 "$SYSTEMD_SERVICE_FILE"
$ESCALATION_TOOL systemctl daemon-reload "$ESCALATION_TOOL" systemctl daemon-reload
printf "Service $SERVICE_NAME has been created and is ready to be started.\n" printf "Service $SERVICE_NAME has been created and is ready to be started.\n"
# Optionally, enable and start the service # Optionally, enable and start the service
@ -237,8 +237,8 @@ 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" "$ESCALATION_TOOL" systemctl start "$SERVICE_NAME"
$ESCALATION_TOOL systemctl enable "$SERVICE_NAME" "$ESCALATION_TOOL" systemctl enable "$SERVICE_NAME"
printf "Service $SERVICE_NAME has been started and enabled.\n" printf "Service $SERVICE_NAME has been started and enabled.\n"
else else
printf "Service $SERVICE_NAME has been created but not started.\n" printf "Service $SERVICE_NAME has been created but not started.\n"

View File

@ -59,11 +59,11 @@ disable_password_auth() {
read -r host_alias read -r host_alias
printf "%b\n" printf "%b\n"
ssh $host_alias " ssh $host_alias "
$ESCALATION_TOOL -S sed -i 's/^#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config && "$ESCALATION_TOOL" -S sed -i 's/^#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config &&
$ESCALATION_TOOL -S sed -i 's/^PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config && "$ESCALATION_TOOL" -S sed -i 's/^PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config &&
$ESCALATION_TOOL -S sed -i 's/^#PubkeyAuthentication no/PubkeyAuthentication yes/' /etc/ssh/sshd_config && "$ESCALATION_TOOL" -S sed -i 's/^#PubkeyAuthentication no/PubkeyAuthentication yes/' /etc/ssh/sshd_config &&
$ESCALATION_TOOL -S sed -i 's/^PubkeyAuthentication no/PubkeyAuthentication yes/' /etc/ssh/sshd_config && "$ESCALATION_TOOL" -S sed -i 's/^PubkeyAuthentication no/PubkeyAuthentication yes/' /etc/ssh/sshd_config &&
$ESCALATION_TOOL -S systemctl restart sshd "$ESCALATION_TOOL" -S systemctl restart sshd
" "
printf "%b\n" "PasswordAuthentication set to no and PubkeyAuthentication set to yes." printf "%b\n" "PasswordAuthentication set to no and PubkeyAuthentication set to yes."
} }
@ -74,11 +74,11 @@ enable_password_auth() {
read -r host_alias read -r host_alias
printf "\n" printf "\n"
ssh $host_alias " ssh $host_alias "
$ESCALATION_TOOL -S sed -i 's/^#PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config && "$ESCALATION_TOOL" -S sed -i 's/^#PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config &&
$ESCALATION_TOOL -S sed -i 's/^PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config && "$ESCALATION_TOOL" -S sed -i 's/^PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config &&
$ESCALATION_TOOL -S sed -i 's/^#PubkeyAuthentication yes/PubkeyAuthentication no/' /etc/ssh/sshd_config && "$ESCALATION_TOOL" -S sed -i 's/^#PubkeyAuthentication yes/PubkeyAuthentication no/' /etc/ssh/sshd_config &&
$ESCALATION_TOOL -S sed -i 's/^PubkeyAuthentication yes/PubkeyAuthentication no/' /etc/ssh/sshd_config && "$ESCALATION_TOOL" -S sed -i 's/^PubkeyAuthentication yes/PubkeyAuthentication no/' /etc/ssh/sshd_config &&
$ESCALATION_TOOL -S systemctl restart sshd "$ESCALATION_TOOL" -S systemctl restart sshd
" "
printf "%b\n" "PasswordAuthentication set to yes and PubkeyAuthentication set to no." printf "%b\n" "PasswordAuthentication set to yes and PubkeyAuthentication set to no."
} }

View File

@ -8,12 +8,12 @@ install_timeshift() {
printf "%b\n" "${YELLOW}Checking if Timeshift is installed...${RC}" printf "%b\n" "${YELLOW}Checking if Timeshift is installed...${RC}"
if ! command_exists timeshift; then if ! command_exists timeshift; then
case ${PACKAGER} in case "$PACKAGER" in
pacman) pacman)
$ESCALATION_TOOL "${PACKAGER}" -S --noconfirm timeshift "$ESCALATION_TOOL" "${PACKAGER}" -S --noconfirm timeshift
;; ;;
*) *)
$ESCALATION_TOOL "${PACKAGER}" install -y timeshift "$ESCALATION_TOOL" "${PACKAGER}" install -y timeshift
;; ;;
esac esac
else else
@ -37,13 +37,13 @@ display_menu() {
# Function to list snapshots # Function to list snapshots
list_snapshots() { list_snapshots() {
printf "%b\n" "${CYAN}Listing snapshots...${RC}" printf "%b\n" "${CYAN}Listing snapshots...${RC}"
$ESCALATION_TOOL timeshift --list-snapshots "$ESCALATION_TOOL" timeshift --list-snapshots
} }
# Function to list devices # Function to list devices
list_devices() { list_devices() {
printf "%b\n" "${CYAN}Listing available devices...${RC}" printf "%b\n" "${CYAN}Listing available devices...${RC}"
$ESCALATION_TOOL timeshift --list-devices "$ESCALATION_TOOL" timeshift --list-devices
} }
# Function to create a new snapshot # Function to create a new snapshot
@ -55,13 +55,13 @@ create_snapshot() {
if [ -z "$COMMENT" ] && [ -z "$TAG" ]; then if [ -z "$COMMENT" ] && [ -z "$TAG" ]; then
printf "%b\n" "${CYAN}Creating snapshot with no comment or tag...${RC}" printf "%b\n" "${CYAN}Creating snapshot with no comment or tag...${RC}"
$ESCALATION_TOOL timeshift --create "$ESCALATION_TOOL" timeshift --create
elif [ -z "$TAG" ]; then elif [ -z "$TAG" ]; then
printf "%b\n" "${CYAN}Creating snapshot with no tag...${RC}" printf "%b\n" "${CYAN}Creating snapshot with no tag...${RC}"
$ESCALATION_TOOL timeshift --create --comments "$COMMENT" "$ESCALATION_TOOL" timeshift --create --comments "$COMMENT"
else else
printf "%b\n" "${CYAN}Creating snapshot with tag: $TAG...${RC}" printf "%b\n" "${CYAN}Creating snapshot with tag: $TAG...${RC}"
$ESCALATION_TOOL timeshift --create --comments "$COMMENT" --tags "$TAG" "$ESCALATION_TOOL" timeshift --create --comments "$COMMENT" --tags "$TAG"
fi fi
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
@ -83,11 +83,11 @@ restore_snapshot() {
read -r SKIP_GRUB read -r SKIP_GRUB
if [ "$SKIP_GRUB" = "yes" ]; then if [ "$SKIP_GRUB" = "yes" ]; then
$ESCALATION_TOOL timeshift --restore --snapshot "$SNAPSHOT" --target-device "$TARGET_DEVICE" --skip-grub --yes "$ESCALATION_TOOL" timeshift --restore --snapshot "$SNAPSHOT" --target-device "$TARGET_DEVICE" --skip-grub --yes
else else
printf "%b\n" "${CYAN}Enter GRUB device (e.g., /dev/sda): ${RC}" printf "%b\n" "${CYAN}Enter GRUB device (e.g., /dev/sda): ${RC}"
read -r GRUB_DEVICE read -r GRUB_DEVICE
$ESCALATION_TOOL timeshift --restore --snapshot "$SNAPSHOT" --target-device "$TARGET_DEVICE" --grub-device "$GRUB_DEVICE" --yes "$ESCALATION_TOOL" timeshift --restore --snapshot "$SNAPSHOT" --target-device "$TARGET_DEVICE" --grub-device "$GRUB_DEVICE" --yes
fi fi
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
@ -105,7 +105,7 @@ delete_snapshot() {
read -r SNAPSHOT read -r SNAPSHOT
printf "%b\n" "${YELLOW}Deleting snapshot $SNAPSHOT...${RC}" printf "%b\n" "${YELLOW}Deleting snapshot $SNAPSHOT...${RC}"
$ESCALATION_TOOL timeshift --delete --snapshot "$SNAPSHOT" --yes "$ESCALATION_TOOL" timeshift --delete --snapshot "$SNAPSHOT" --yes
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
printf "%b\n" "${GREEN}Snapshot deleted successfully.${RC}" printf "%b\n" "${GREEN}Snapshot deleted successfully.${RC}"
@ -122,7 +122,7 @@ delete_all_snapshots() {
if [ "$CONFIRMATION" = "yes" ]; then if [ "$CONFIRMATION" = "yes" ]; then
printf "%b\n" "${CYAN}Deleting all snapshots...${RC}" printf "%b\n" "${CYAN}Deleting all snapshots...${RC}"
$ESCALATION_TOOL timeshift --delete-all --yes "$ESCALATION_TOOL" timeshift --delete-all --yes
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
printf "%b\n" "${GREEN}All snapshots deleted successfully.${RC}" printf "%b\n" "${GREEN}All snapshots deleted successfully.${RC}"
else else

View File

@ -18,7 +18,8 @@ available_groups=$(cut -d: -f1 /etc/group | sort | tr '\n' ' ')
printf "%b\n" "${YELLOW}Available groups:${RC} $available_groups" printf "%b\n" "${YELLOW}Available groups:${RC} $available_groups"
printf "%b\n" "${YELLOW}=================${RC}" printf "%b\n" "${YELLOW}=================${RC}"
read -p "Enter the groups you want to add user $username to (space-separated): " groups printf "%b\n" "${YELLOW}Enter the groups you want to add user $username to (space-separated):${RC} "
read -r groups
checkEmpty "$groups" || exit 1 checkEmpty "$groups" || exit 1
checkGroupAvailabe "$groups" "$available_groups" || exit 1 checkGroupAvailabe "$groups" "$available_groups" || exit 1

View File

@ -18,7 +18,7 @@ fi
password=$(promptPassword) || exit 1 password=$(promptPassword) || exit 1
$ESCALATION_TOOL useradd -m "$username" -g users -s /bin/bash $ESCALATION_TOOL useradd -m "$username" -g users -s /bin/bash
echo "$username:$password" | $ESCALATION_TOOL chpasswd echo "$username:$password" | "$ESCALATION_TOOL" chpasswd
printf "%b\n" "${GREEN}User $username created successfully${RC}" printf "%b\n" "${GREEN}User $username created successfully${RC}"
printf "%b\n" "${GREEN}To add additional groups use Add User To Groups${RC}" printf "%b\n" "${GREEN}To add additional groups use Add User To Groups${RC}"

View File

@ -14,7 +14,7 @@ printf "Are you sure you want to change password for $username? [Y/N]: "
read -r confirm read -r confirm
confirmAction || exit 1 confirmAction || exit 1
echo "$username:$password" | $ESCALATION_TOOL chpasswd echo "$username:$password" | "$ESCALATION_TOOL" chpasswd
printf "%b\n" "${GREEN}Password changed successfully${RC}" printf "%b\n" "${GREEN}Password changed successfully${RC}"
checkEnv checkEnv

View File

@ -13,7 +13,8 @@ user_groups=$(groups "$username" | cut -d: -f2 | sort | tr '\n' ' ')
printf "%b\n" "${YELLOW}Groups user $username is in:${RC} $user_groups" printf "%b\n" "${YELLOW}Groups user $username is in:${RC} $user_groups"
printf "%b\n" "${YELLOW}=================${RC}" printf "%b\n" "${YELLOW}=================${RC}"
read -p "Enter the groups you want to remove user from $username (space-separated): " groups printf "%b\n" "${YELLOW}Enter the groups you want to remove user $username from (space-separated):${RC} "
read -r groups
checkEmpty "$groups" || exit 1 checkEmpty "$groups" || exit 1
checkGroupAvailabe "$groups" "$user_groups" || exit 1 checkGroupAvailabe "$groups" "$user_groups" || exit 1