mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2025-01-31 08:25:32 +00:00
16 lines
219 B
Plaintext
16 lines
219 B
Plaintext
|
#!/bin/bash
|
||
|
|
||
|
usr=$1
|
||
|
uid=$2
|
||
|
grp=$3
|
||
|
gid=$4
|
||
|
shift 4
|
||
|
|
||
|
groupadd -g ${gid} ${grp}
|
||
|
useradd -d /home/${usr} -m -g ${gid} -u ${uid} ${usr}
|
||
|
if [ -z "$*" ]; then
|
||
|
exec su -l ${usr}
|
||
|
else
|
||
|
exec su -l -c "/bin/bash -c '$*'"
|
||
|
fi
|