|
- #!/bin/sh -
- #
- # Script to setup the environment
- #
-
- . $(dirname $0)/settings.conf
-
- if ! id $labuser > /dev/null 2>&1; then
- # create the user and group
- echo setting up accounts...
- pw groupadd "$labuser" -g "$labuid"
- # /bin/sh is required for commands specified in authorized_keys to run
- pw useradd "$labuser" -u "$labuid" -c "Embedded Lab User" \
- -d "$labhome" -g "$labuid" -s "/bin/sh"
- else
- echo accounts already setup...
- fi
-
- echo 'setting permissions...'
-
- chown "$labuser" "$labhome"
-
- if ! zfs list "$labuserzfs" 2>/dev/null; then
- zfs create "$labuserzfs"
- fi
-
- # XXX - decide how to do ZFS quotas
- # even if a user quota was generic (it isn't), w/ the datasets
- # being root owned, a flat quota for "$labuserzfs/$user" seems
- # to make the most sense
|