
* Direct use of the $HOME variable.
* Sudo check witch variable $HOME.
Direct use of the $HOME variable.
* Changing for Error 208
Changing description and title for error 208
* Revert "Changing for Error 208"
This reverts commit f45624c023
.
* Changing for Error 207
Changing description and title for Error 207
13 lines
657 B
Bash
13 lines
657 B
Bash
if which apt-get > /dev/null 2>&1; then pm=$(which apt-get); opt="--version";\
|
|
elif which dnf > /dev/null 2>&1; then pm=$(which dnf); opt="--version";\
|
|
elif which yum > /dev/null 2>&1; then pm=$(which yum); opt="--version";\
|
|
elif which pacman > /dev/null 2>&1; then pm=$(which pacman); opt="--version";\
|
|
else pm="uname"; opt="-a";\
|
|
fi;\
|
|
CUR_USER=$(whoami 2>/dev/null || echo $HOME | sed 's/.*\///');\
|
|
echo $LANG | grep -qE '^(en_US.UTF-8|C.UTF-8|C)$' || export LC_ALL=C;\
|
|
sudo -K;\
|
|
cd ~;\
|
|
if [ "$CUR_USER" = "root" ] || ( groups "$CUR_USER" | grep -E '\<(sudo|wheel)\>' ); then \
|
|
sudo -nu $CUR_USER $pm $opt > /dev/null; sudo -n $pm $opt > /dev/null;\
|
|
fi
|