Set of files and scripts for Embedded Lab 1
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

31 lines
759 B

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