Files
fun_with_env/lib/root
Patrick Verschuer 1d77beae73 Inital commit
2026-02-10 17:45:43 +01:00

14 lines
311 B
Bash

#!/usr/bin/env bash
rsudo () {
. /etc/os-release
RHEL_MAJOR_VERSION=$(echo "$VERSION_ID" | cut -d'.' -f1)
if [ "$RHEL_MAJOR_VERSION" -eq 7 ]; then
sudo -i /bin/bash -c ". ${WHOIAM}; exec bash"
else
sudo machinectl shell root@.host /bin/bash -c ". /etc/profile; . ${WHOIAM}; exec bash"
fi
}