|
|
|
@ -4,7 +4,7 @@ set -ex
|
|
|
|
# If we are a root in a Docker container and `sudo` doesn't exist
|
|
|
|
# If we are a root in a Docker container and `sudo` doesn't exist
|
|
|
|
# lets overwrite it with a function that just executes things passed to sudo
|
|
|
|
# lets overwrite it with a function that just executes things passed to sudo
|
|
|
|
# (yeah it won't work for sudo executed with flags)
|
|
|
|
# (yeah it won't work for sudo executed with flags)
|
|
|
|
if [ -f /.dockerenv ] && ! hash sudo 2>/dev/null && whoami | grep root; then
|
|
|
|
if [ -f /.dockerenv ] && ! hash sudo 2>/dev/null && whoami | grep root; then
|
|
|
|
sudo() {
|
|
|
|
sudo() {
|
|
|
|
$*
|
|
|
|
$*
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -48,7 +48,7 @@ else
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if linux; then
|
|
|
|
if linux; then
|
|
|
|
distro=$(cat /etc/os-release | grep "^ID=" | cut -d\= -f2 | sed -e 's/"//g')
|
|
|
|
distro=$(grep "^ID=" /etc/os-release | cut -d'=' -f2 | sed -e 's/"//g')
|
|
|
|
|
|
|
|
|
|
|
|
case $distro in
|
|
|
|
case $distro in
|
|
|
|
"ubuntu")
|
|
|
|
"ubuntu")
|
|
|
|
|