dotfiles/root/usr/local/bin/chroot-client

18 lines
239 B
Plaintext
Raw Normal View History

2021-07-15 14:15:45 +00:00
#!/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