Skip to content
Snippets Groups Projects
Commit e46bd05b authored by Alberto LIVIO BECCARIA's avatar Alberto LIVIO BECCARIA
Browse files

Merge branch 'master' of gitlab.di.unipmn.it:ulisse/labmanager-systemd

parents f3fde497 a4d4bac8
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,8 @@ GIT_URL=https://gitlab.di.unipmn.it
GIT_BASE_DIR=ulisse/labmanager-systemd/raw
GIT_BRANCH=master
ESAME_DIR=/opt/esame
BIN_FILES=( "desktop-wallpaper" "esamesync-esame.sh" "firefox-home" "get-config" "iptables-rules" "kdm-autologin" "kioskmode" "mk-homedir" "nfs" "usb" "virtualbox" )
SYSTEMD_FILES=( "esame-desktop-wallpaper.service" "esame-firefox-home.service" "esame-get-config-boot.service" "esame-get-config.service" "esame-iptables-rules.service" "esame-kdm-autologin.service" "esame-kioskmode.service" "esame-mk-homedir.service" "esame-nfs.service" "esame-usb.service" "esame-virtualbox.service" "esamesync-esame.service" "esame-get-config.timer" "esame-configurator.target" "esame.target" "esamekiosk.target" )
......@@ -34,6 +36,29 @@ OLD_FILES=(
# DON'T TOUCH UNDER THIS LINE! #################################################
# Create a users
myuseradd() {
if [ "z$1" == "z" ]; then
echo "myuseradd: No user specified! Nothing to do."
return
fi
R_USER="$1"
R_UID=""
if [ "z$2" != "z" ]; then
R_UID="-u $2"
fi
R_GID="-U"
if [ "z$3" != "z" ]; then
# We need to create the group before creating the user
R_GID="-g $3"
groupadd ${R_GID} -r ${R_USER}
fi
useradd -b /local -m ${R_UID} ${R_GID} -r ${R_USER}
if [ $? -ne 0 ]; then
echo "Error creating user ${R_USER}"
fi
}
function removeFiles {
local files=( "$@" )
......@@ -89,6 +114,16 @@ removeFiles ${OLD_FILES[@]}
echo
echo
# Create all 'esame' users, with homes under '/local'
mkdir -p /local
mkdir -p ${ESAME_DIR}
#useradd -b /local -m -u 968 -U -g 968 -r esamesync
myuseradd esamesync 451 451
myuseradd esame
myuseradd moodle
myuseradd rdesktop
mkdir -p /usr/libexec/labmanager
# script per i servizi systemd
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment