mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-22 05:12:27 +00:00
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:
parent
b62b14da31
commit
41817c333c
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user