Integrate fix for #18 and #21

parent 827dc6d3
...@@ -5,12 +5,19 @@ then ...@@ -5,12 +5,19 @@ then
apt-get -y install cifs-utils smbclient apt-get -y install cifs-utils smbclient
fi fi
for d in /home/shares/*/*
do
umount $d > /dev/null 2>&1 || umount $d/* > /dev/null 2>&1
rmdir $d/* > /dev/null 2>&1
rmdir $d > /dev/null 2>&1
done
# Remove all ^//ecole-dc lines in fstab # Remove all ^//ecole-dc lines in fstab
sed -i.bak '/^\/\/ecole-dc/d' /etc/fstab sed -i.bak '/^\/\/ecole-dc/d' /etc/fstab
declare -A LEVELS declare -A LEVELS
LEVELS=(['01-mini']='cp' ['02-super']='ce' ['03-maxi']='cm') LEVELS=(['01-mini']='CP' ['02-super']='CE' ['03-maxi']='CM')
CLASSES=(['01-mini']='01-cp' ['02-super']='02-ce1-ce2' ['03-maxi']='03-cm1-cm2') CLASSES=(['01-mini']='01-CP' ['02-super']='02-CE1-CE2' ['03-maxi']='03-CM1-CM2')
# Students # Students
for usr in 01-mini 02-super 03-maxi for usr in 01-mini 02-super 03-maxi
...@@ -19,22 +26,23 @@ do ...@@ -19,22 +26,23 @@ do
mkdir -p /home/shares/$usr/PROFESSEURS mkdir -p /home/shares/$usr/PROFESSEURS
chown -R $usr:$usr /home/shares/$usr chown -R $usr:$usr /home/shares/$usr
lvl=${LEVELS[$usr]} lvl=${LEVELS[$usr]}
if [ $lvl != 'cp' ] if [ $lvl != 'CP' ]
then then
lvl2="${lvl}1-${lvl}2" lvl2="${lvl}1-${lvl}2"
else else
lvl2=$lvl lvl2=$lvl
fi fi
lvlcred=$(echo "$lvl" | awk '{print tolower($0)}')
cat <<EOF>>/etc/fstab cat <<EOF>>/etc/fstab
//ecole-dc/$lvl2/donnees /home/shares/$usr/PROFESSEURS/ cifs _netdev,users,noauto,credentials=/etc/cifs/secrets/$lvl,uid=$usr,gid=$usr 0 0 //ecole-dc/$lvl2/donnees /home/shares/$usr/PROFESSEURS/ cifs _netdev,users,noauto,credentials=/etc/cifs/secrets/$lvlcred,uid=$usr,gid=$usr 0 0
//ecole-dc/$lvl2/travail /home/shares/$usr/ELEVES/ cifs _netdev,users,noauto,credentials=/etc/cifs/secrets/$lvl,uid=$usr,gid=$usr 0 0 //ecole-dc/$lvl2/travail /home/shares/$usr/ELEVES/ cifs _netdev,users,noauto,credentials=/etc/cifs/secrets/$lvlcred,uid=$usr,gid=$usr 0 0
EOF EOF
done done
# profs # profs
for usr in prof direction for usr in prof direction
do do
mkdir -p /home/shares/$usr/SCAN mkdir -p /home/shares/$usr/SCAN
for classe in 01-cp 02-ce1-ce2 03-cm1-cm2 for classe in 01-CP 02-CE1-CE2 03-CM1-CM2
do do
mkdir -p /home/shares/$usr/$classe/PROFESSEURS mkdir -p /home/shares/$usr/$classe/PROFESSEURS
mkdir -p /home/shares/$usr/$classe/ELEVES mkdir -p /home/shares/$usr/$classe/ELEVES
......
...@@ -13,7 +13,9 @@ do ...@@ -13,7 +13,9 @@ do
rm $HOME/Documents/$d/{ELEVES,PROFESSEURS} > /dev/null 2>&1 rm $HOME/Documents/$d/{ELEVES,PROFESSEURS} > /dev/null 2>&1
rmdir $HOME/Documents/$d > /dev/null 2>&1 rmdir $HOME/Documents/$d > /dev/null 2>&1
done done
rm $HOME/Documents/SCAN $HOME/Documents/CONFIDENTIEL > /dev/null 2>&1 rm $HOME/Documents/SCAN $HOME/Documents/CONFIDENTIEL \
$HOME/Documents/CONFIDENTIEL_DIRECTION \
$HOME/Documents/CONFIDENTIEL_PROFESSEURS > /dev/null 2>&1
mkdir -p $HOME/.config/gtk-3.0 mkdir -p $HOME/.config/gtk-3.0
...@@ -65,4 +67,4 @@ case "$USER" in ...@@ -65,4 +67,4 @@ case "$USER" in
echo file://$DOCUMENTS/CONFIDENTIEL_DIRECTION CONFIDENTIEL_DIRECTION >> $HOME/.config/gtk-3.0/bookmarks echo file://$DOCUMENTS/CONFIDENTIEL_DIRECTION CONFIDENTIEL_DIRECTION >> $HOME/.config/gtk-3.0/bookmarks
echo file://$DOCUMENTS/CONFIDENTIEL_PROFESSEURS CONFIDENTIEL_PROFESSEURS >> $HOME/.config/gtk-3.0/bookmarks echo file://$DOCUMENTS/CONFIDENTIEL_PROFESSEURS CONFIDENTIEL_PROFESSEURS >> $HOME/.config/gtk-3.0/bookmarks
;; ;;
esac esac
\ No newline at end of file
...@@ -34,6 +34,7 @@ $DIR/create_cifs_mounts.sh ...@@ -34,6 +34,7 @@ $DIR/create_cifs_mounts.sh
$DIR/set_mime_apps.sh $DIR/set_mime_apps.sh
$DIR/set_screens.sh $DIR/set_screens.sh
$DIR/install_print_drivers.sh $DIR/install_print_drivers.sh
$DIR/fix_libreoffice.sh
$DIR/install_vnc.sh $DIR/install_vnc.sh
# Install missing libreoffice gtk # Install missing libreoffice gtk
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment