Replace echos with printf in system-setup (#483)

Co-authored-by: nnyyxxxx <nnyyxxxx@users.noreply.github.com>
Co-authored-by: Chris Titus <contact@christitus.com>
This commit is contained in:
Nyx 2024-09-18 20:40:05 -04:00 committed by GitHub
parent b62b14da31
commit 41817c333c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 17 additions and 17 deletions

View File

@ -86,20 +86,20 @@ setup_samba() {
$ESCALATION_TOOL chmod -R 0777 "$SHARED_DIR" $ESCALATION_TOOL chmod -R 0777 "$SHARED_DIR"
# Add a new Samba user # Add a new Samba user
echo "Enter Samba username: " printf "Enter Samba username: "
read -r SAMBA_USER read -r SAMBA_USER
# Loop until the passwords match # Loop until the passwords match
while true; do while true; do
echo "Enter Samba password: " printf "Enter Samba password: "
stty -echo stty -echo
read -r SAMBA_PASSWORD read -r SAMBA_PASSWORD
stty echo stty echo
echo "Confirm Samba password: " printf "Confirm Samba password: "
stty -echo stty -echo
read SAMBA_PASSWORD_CONFIRM read SAMBA_PASSWORD_CONFIRM
stty echo stty echo
echo "" printf "\n"
if [ "$SAMBA_PASSWORD" = "$SAMBA_PASSWORD_CONFIRM" ]; then if [ "$SAMBA_PASSWORD" = "$SAMBA_PASSWORD_CONFIRM" ]; then
printf "%b\n" "${GREEN}Passwords match.${RC}" printf "%b\n" "${GREEN}Passwords match.${RC}"
break break

View File

@ -16,7 +16,7 @@ choose_installation() {
1) INSTALL_DOCKER=1; INSTALL_COMPOSE=0 ;; 1) INSTALL_DOCKER=1; INSTALL_COMPOSE=0 ;;
2) INSTALL_DOCKER=0; INSTALL_COMPOSE=1 ;; 2) INSTALL_DOCKER=0; INSTALL_COMPOSE=1 ;;
3) INSTALL_DOCKER=1; 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 esac
} }

View File

@ -6,17 +6,17 @@ installDepend() {
case "$PACKAGER" in case "$PACKAGER" in
pacman) pacman)
if ! command_exists paru; then 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 $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
echo "Paru installed" printf "%b\n" "${GREEN}Paru installed${RC}"
else else
echo "Paru already installed" printf "%b\n" "${GREEN}Paru already installed${RC}"
fi fi
;; ;;
*) *)
echo "Unsupported package manager: $PACKAGER" printf "%b\n" "${RED}Unsupported package manager: $PACKAGER${RC}"
;; ;;
esac esac
} }

View File

@ -6,17 +6,17 @@ installDepend() {
case "$PACKAGER" in case "$PACKAGER" in
pacman) pacman)
if ! command_exists yay; then 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 $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
echo "Yay installed" printf "%b\n" "${GREEN}Yay installed${RC}"
else else
echo "Aur helper already installed" printf "%b\n" "${GREEN}Aur helper already installed${RC}"
fi fi
;; ;;
*) *)
echo "Unsupported package manager: $PACKAGER" printf "%b\n" "${RED}Unsupported package manager: $PACKAGER${RC}"
;; ;;
esac esac
} }

View File

@ -8,16 +8,16 @@ installRPMFusion() {
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
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" 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 "$ESCALATION_TOOL" "$PACKAGER" config-manager --enable fedora-cisco-openh264
echo "RPM Fusion installed" printf "%b\n" "${GREEN}RPM Fusion installed${RC}"
else else
echo "RPM Fusion already installed" printf "%b\n" "${GREEN}RPM Fusion already installed${RC}"
fi fi
;; ;;
*) *)
echo "Unsupported distribution: $DTYPE" printf "%b\n" "${RED}Unsupported distribution: $DTYPE${RC}"
;; ;;
esac esac
} }