mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2025-06-29 12:10:42 +00:00
Update chroot scripts
This commit is contained in:
parent
b4e3bf49c8
commit
f5980c3e1a
3 changed files with 122 additions and 22 deletions
17
root/usr/local/bin/chroot-client
Executable file
17
root/usr/local/bin/chroot-client
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/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
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue