File indexing completed on 2024-06-16 08:12:44

0001 #!/bin/sh -x
0002 
0003 USER=mycroft
0004 GECOS=mycroft
0005 UGID=32011
0006 PASSWORD=mycroft
0007 
0008 DEFGROUPS="tty,sudo,adm,dialout,cdrom,plugdev,audio,dip,video,i2c"
0009 
0010 echo "I: creating default user $USER"
0011 adduser --gecos $GECOS --disabled-login $USER --uid $UGID
0012 
0013 echo "I: set user $USER password to $PASSWORD"
0014 echo "$USER:$PASSWORD" | /usr/sbin/chpasswd
0015 
0016 mkdir -p /home/$USER/Music
0017 mkdir -p /home/$USER/Pictures
0018 mkdir -p /home/$USER/Videos
0019 mkdir -p /home/$USER/Downloads
0020 mkdir -p /home/$USER/Documents
0021 
0022 # Install default kwallet files
0023 mkdir -p /home/$USER/.local/share
0024 cp -r /etc/skel/.local/kwalletd /home/$USER/.local/share
0025 
0026 chown -R $UGID:$UGID /home/$USER
0027 
0028 usermod -a -G ${DEFGROUPS} ${USER}