dotfiles/root/usr/local/bin/chroot-client
2021-07-15 16:15:45 +02:00

18 lines
239 B
Bash
Executable file

#!/bin/sh
if [ $# -ge 1 ]; then
if ! id "$1" &>/dev/null; then
echo "No such user, give valid username"
else
USERNAME="$1"
fi
else
USERNAME="root"
fi
source /etc/profile
exec su "$USERNAME" --login
exit