mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-25 14:30:11 +00:00
feat(dwmtitus-setup): improve slstatus installation using loop
This commit is contained in:
parent
65f26795bb
commit
b46569c38b
|
@ -296,27 +296,30 @@ setupDisplayManager() {
|
||||||
}
|
}
|
||||||
|
|
||||||
install_slstatus() {
|
install_slstatus() {
|
||||||
printf "Do you want to install slstatus? (y/n): " # using printf instead of 'echo' to avoid newline, -n flag for 'echo' is not supported in POSIX
|
while true; do
|
||||||
read -r response # -r flag to prevent backslashes from being interpreted
|
printf "Do you want to install slstatus? (y/n): " # using printf instead of 'echo' to avoid newline, -n flag for 'echo' is not supported in POSIX
|
||||||
case "$response" in
|
read -r response # -r flag to prevent backslashes from being interpreted
|
||||||
[Yy] | [Yy][Ee][Ss]) # Matches: Y, y, Yes, yes, YES, yEs, yeS, etc.
|
case "$response" in
|
||||||
echo "Installing slstatus"
|
[Yy] | [Yy][Ee][Ss]) # Matches: Y, y, Yes, yes, YES, yEs, yeS, etc.
|
||||||
cd slstatus/ || { echo "Failed to change directory to slstatus"; return 1; }
|
echo "Installing slstatus"
|
||||||
if $ESCALATION_TOOL make clean install; then
|
cd slstatus/ || { echo "Failed to change directory to slstatus"; return 1; }
|
||||||
echo "slstatus installed successfully"
|
if $ESCALATION_TOOL make clean install; then
|
||||||
else
|
echo "slstatus installed successfully"
|
||||||
echo "Failed to install slstatus"
|
else
|
||||||
return 1
|
echo "Failed to install slstatus"
|
||||||
fi
|
return 1
|
||||||
;;
|
fi
|
||||||
[Nn] | [Nn][Oo]) # same logic as above, but for No
|
break
|
||||||
echo "Skipping slstatus installation"
|
;;
|
||||||
;;
|
[Nn] | [Nn][Oo]) # same logic as above, but for No
|
||||||
*)
|
echo "Skipping slstatus installation"
|
||||||
echo "Invalid input. Please enter y/yes or n/no."
|
break
|
||||||
install_slstatus
|
;;
|
||||||
;;
|
*)
|
||||||
esac
|
echo "Invalid input. Please enter y/yes or n/no."
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
cd ..
|
cd ..
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user