1# add users (create home directories)
2mkdir -p /primary/home
3if [ -f /etc/redhat-release ]; then
4    # TODO: mkpassword from 'expect' doesn't actually generate hashed passwords;
5    # find a utility that does
6    yum install -y expect
7else
8    apt-get install -y whois
9fi
10for userdetails in `cat /rstudio/vagrant/rstudiousers.txt`
11do
12    user=`echo $userdetails | cut -f 1 -d ,`
13    passwd=`echo $userdetails | cut -f 2 -d ,`
14    useradd --base-dir /primary/home --create-home -p `mkpasswd $passwd` $user
15done
16
17