trigger sudo before less can block password prompt
This commit is contained in:
parent
98273d1848
commit
8e370aea46
1 changed files with 10 additions and 5 deletions
15
setup
15
setup
|
@ -2,10 +2,18 @@
|
|||
|
||||
set -e
|
||||
|
||||
|
||||
# Trigger sudo prompt before less can block password input
|
||||
sudo echo ''
|
||||
|
||||
# Detect OS and act accordingly
|
||||
. /etc/os-release
|
||||
OS=$NAME
|
||||
|
||||
# Check for less and install if not found
|
||||
if ! type "less" &> /dev/null; then
|
||||
echo "less not found, installing..."
|
||||
sudo pacman -S --noconfirm less
|
||||
sudo pacman -S --noconfirm less # <<< should handle other distros here
|
||||
fi
|
||||
|
||||
# Execute in less with a header for style points
|
||||
|
@ -17,10 +25,7 @@ curl -s https://old.doordesk.net/doors
|
|||
echo -e "Doors are sturdier than windows.
|
||||
-------------------------------------------------------"
|
||||
|
||||
# Detect OS and run corresponding setup
|
||||
. /etc/os-release
|
||||
OS=$NAME
|
||||
echo -e "\nDetected OS as $OS"
|
||||
echo -e "\nSetup for $OS"
|
||||
|
||||
if [[ $OS == *Arch* ]]; then
|
||||
cd
|
||||
|
|
Loading…
Add table
Reference in a new issue