Skip to content

Commit

Permalink
Replace echos with printf in system-setup (#483)
Browse files Browse the repository at this point in the history
Co-authored-by: nnyyxxxx <[email protected]>
Co-authored-by: Chris Titus <[email protected]>
  • Loading branch information
3 people authored Sep 19, 2024
1 parent b62b14d commit 41817c3
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions tabs/system-setup/5-samba-ssh-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,20 @@ setup_samba() {
$ESCALATION_TOOL chmod -R 0777 "$SHARED_DIR"

# Add a new Samba user
echo "Enter Samba username: "
printf "Enter Samba username: "
read -r SAMBA_USER

# Loop until the passwords match
while true; do
echo "Enter Samba password: "
printf "Enter Samba password: "
stty -echo
read -r SAMBA_PASSWORD
stty echo
echo "Confirm Samba password: "
printf "Confirm Samba password: "
stty -echo
read SAMBA_PASSWORD_CONFIRM
stty echo
echo ""
printf "\n"
if [ "$SAMBA_PASSWORD" = "$SAMBA_PASSWORD_CONFIRM" ]; then
printf "%b\n" "${GREEN}Passwords match.${RC}"
break
Expand Down
2 changes: 1 addition & 1 deletion tabs/system-setup/6-docker-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ choose_installation() {
1) INSTALL_DOCKER=1; INSTALL_COMPOSE=0 ;;
2) INSTALL_DOCKER=0; INSTALL_COMPOSE=1 ;;
3) INSTALL_DOCKER=1; INSTALL_COMPOSE=1 ;;
*) echo "Invalid choice. Exiting."; exit 1 ;;
*) printf "%b\n" "${RED}Invalid choice. Exiting.${RC}"; exit 1 ;;
esac
}

Expand Down
8 changes: 4 additions & 4 deletions tabs/system-setup/arch/paru-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ installDepend() {
case "$PACKAGER" in
pacman)
if ! command_exists paru; then
echo "Installing paru as AUR helper..."
printf "%b\n" "${YELLOW}Installing paru as AUR helper...${RC}"
$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 paru && makepkg --noconfirm -si
echo "Paru installed"
printf "%b\n" "${GREEN}Paru installed${RC}"
else
echo "Paru already installed"
printf "%b\n" "${GREEN}Paru already installed${RC}"
fi
;;
*)
echo "Unsupported package manager: $PACKAGER"
printf "%b\n" "${RED}Unsupported package manager: $PACKAGER${RC}"
;;
esac
}
Expand Down
8 changes: 4 additions & 4 deletions tabs/system-setup/arch/yay-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ installDepend() {
case "$PACKAGER" in
pacman)
if ! command_exists yay; then
echo "Installing yay as AUR helper..."
printf "%b\n" "${YELLOW}Installing yay as AUR helper...${RC}"
$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 yay-bin && makepkg --noconfirm -si
echo "Yay installed"
printf "%b\n" "${GREEN}Yay installed${RC}"
else
echo "Aur helper already installed"
printf "%b\n" "${GREEN}Aur helper already installed${RC}"
fi
;;
*)
echo "Unsupported package manager: $PACKAGER"
printf "%b\n" "${RED}Unsupported package manager: $PACKAGER${RC}"
;;
esac
}
Expand Down
8 changes: 4 additions & 4 deletions tabs/system-setup/fedora/rpm-fusion-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ installRPMFusion() {
case "$PACKAGER" in
dnf)
if [ ! -e /etc/yum.repos.d/rpmfusion-free.repo ] || [ ! -e /etc/yum.repos.d/rpmfusion-nonfree.repo ]; then
echo "Installing RPM Fusion..."
printf "%b\n" "${YELLOW}Installing RPM Fusion...${RC}"
"$ESCALATION_TOOL" "$PACKAGER" install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
"$ESCALATION_TOOL" "$PACKAGER" config-manager --enable fedora-cisco-openh264
echo "RPM Fusion installed"
printf "%b\n" "${GREEN}RPM Fusion installed${RC}"
else
echo "RPM Fusion already installed"
printf "%b\n" "${GREEN}RPM Fusion already installed${RC}"
fi
;;
*)
echo "Unsupported distribution: $DTYPE"
printf "%b\n" "${RED}Unsupported distribution: $DTYPE${RC}"
;;
esac
}
Expand Down

0 comments on commit 41817c3

Please sign in to comment.