Commit 827dc6d3 authored by Metro Admin's avatar Metro Admin

Update session.sh à l'identique de la branche Primtux4

parent eb1fc440
#!/bin/bash
SCOPE1=cp
SCOPE2=ce1-ce2
SCOPE3=cm1-cm2
SCOPE41=profs-cp
SCOPE42=profs-ce1-ce2
SCOPE43=profs-cm1-cm2
SCOPE5=direction
SCOPE1=CP
SCOPE2=CE1-CE2
SCOPE3=CM1-CM2
SHARE_DIR="/home/shares/$USER"
while ! /bin/ping -c 2 ecole-dc; do sleep 10; done;
for d in 01-cp 02-ce1-ce2 03-cm1-cm2
do
rm $HOME/Documents/{ELEVES,PROFESSEURS} > /dev/null 2>&1
rm $HOME/Documents/$d/{ELEVES,PROFESSEURS} > /dev/null 2>&1
rmdir $HOME/Documents/$d > /dev/null 2>&1
done
rm $HOME/Documents/SCAN $HOME/Documents/CONFIDENTIEL > /dev/null 2>&1
mkdir -p $HOME/.config/gtk-3.0
DOCUMENTS="$HOME/Documents/Partages_Serveur"
mkdir -p $DOCUMENTS
case "$USER" in
"01-mini"|"02-super"|"03-maxi")
ln -sf $SHARE_DIR/ELEVES $HOME/Documents/ELEVES
ln -sf $SHARE_DIR/PROFESSEURS $HOME/Documents/PROFESSEURS
echo file://$SHARE_DIR/ELEVES ELEVES > $HOME/.config/gtk-3.0/bookmarks
echo file://$SHARE_DIR/PROFESSEURS PROFESSEURS >> $HOME/.config/gtk-3.0/bookmarks
ln -sf $SHARE_DIR/ELEVES $DOCUMENTS/ÉLÈVES
ln -sf $SHARE_DIR/PROFESSEURS $DOCUMENTS/PROFESSEURS
echo file://$DOCUMENTS/ÉLÈVES ÉLÈVES > $HOME/.config/gtk-3.0/bookmarks
echo file://$DOCUMENTS/PROFESSEURS PROFESSEURS >> $HOME/.config/gtk-3.0/bookmarks
;;
"prof")
mkdir -p $HOME/Documents/01-$SCOPE1
mkdir -p $HOME/Documents/02-$SCOPE2
mkdir -p $HOME/Documents/03-$SCOPE3
ln -sf $SHARE_DIR/01-$SCOPE1/ELEVES $HOME/Documents/01-$SCOPE1/ELEVES
ln -sf $SHARE_DIR/01-$SCOPE1/PROFESSEURS $HOME/Documents/01-$SCOPE1/PROFESSEURS
ln -sf $SHARE_DIR/02-$SCOPE2/ELEVES $HOME/Documents/02-$SCOPE2/ELEVES
ln -sf $SHARE_DIR/02-$SCOPE2/PROFESSEURS $HOME/Documents/02-$SCOPE2/PROFESSEURS
ln -sf $SHARE_DIR/03-$SCOPE3/ELEVES $HOME/Documents/03-$SCOPE3/ELEVES
ln -sf $SHARE_DIR/03-$SCOPE3/PROFESSEURS $HOME/Documents/03-$SCOPE3/PROFESSEURS
ln -sf $SHARE_DIR/SCAN $HOME/Documents/SCAN
ln -sf $SHARE_DIR/CONFIDENTIEL $HOME/Documents/CONFIDENTIEL
echo file://$SHARE_DIR/01-$SCOPE1/ELEVES 01-$SCOPE1/ELEVES > $HOME/.config/gtk-3.0/bookmarks
echo file://$SHARE_DIR/01-$SCOPE1/PROFESSEURS 01-$SCOPE1/PROFESSEURS >> $HOME/.config/gtk-3.0/bookmarks
echo file://$SHARE_DIR/02-$SCOPE2/ELEVES 02-$SCOPE2/ELEVES >> $HOME/.config/gtk-3.0/bookmarks
echo file://$SHARE_DIR/02-$SCOPE2/PROFESSEURS 02-$SCOPE2/PROFESSEURS >> $HOME/.config/gtk-3.0/bookmarks
echo file://$SHARE_DIR/03-$SCOPE3/ELEVES 03-$SCOPE3/ELEVES >> $HOME/.config/gtk-3.0/bookmarks
echo file://$SHARE_DIR/03-$SCOPE3/PROFESSEURS 03-$SCOPE3/PROFESSEURS >> $HOME/.config/gtk-3.0/bookmarks
echo file://$SHARE_DIR/SCAN SCAN >> $HOME/.config/gtk-3.0/bookmarks
echo file://$SHARE_DIR/CONFIDENTIEL CONFIDENTIEL >> $HOME/.config/gtk-3.0/bookmarks
mkdir -p $DOCUMENTS/01-$SCOPE1
mkdir -p $DOCUMENTS/02-$SCOPE2
mkdir -p $DOCUMENTS/03-$SCOPE3
ln -sf $SHARE_DIR/01-$SCOPE1/ELEVES $DOCUMENTS/01-$SCOPE1/ÉLÈVES
ln -sf $SHARE_DIR/01-$SCOPE1/PROFESSEURS $DOCUMENTS/01-$SCOPE1/PROFESSEURS
ln -sf $SHARE_DIR/02-$SCOPE2/ELEVES $DOCUMENTS/02-$SCOPE2/ÉLÈVES
ln -sf $SHARE_DIR/02-$SCOPE2/PROFESSEURS $DOCUMENTS/02-$SCOPE2/PROFESSEURS
ln -sf $SHARE_DIR/03-$SCOPE3/ELEVES $DOCUMENTS/03-$SCOPE3/ÉLÈVES
ln -sf $SHARE_DIR/03-$SCOPE3/PROFESSEURS $DOCUMENTS/03-$SCOPE3/PROFESSEURS
ln -sf $SHARE_DIR/SCAN $DOCUMENTS/SCAN
ln -sf $SHARE_DIR/CONFIDENTIEL $DOCUMENTS/CONFIDENTIEL
echo file://$DOCUMENTS/01-$SCOPE1 01-$SCOPE1 > $HOME/.config/gtk-3.0/bookmarks
echo file://$DOCUMENTS/02-$SCOPE2 02-$SCOPE2 >> $HOME/.config/gtk-3.0/bookmarks
echo file://$DOCUMENTS/03-$SCOPE3 03-$SCOPE3 >> $HOME/.config/gtk-3.0/bookmarks
echo file://$DOCUMENTS/SCAN SCAN >> $HOME/.config/gtk-3.0/bookmarks
echo file://$DOCUMENTS/CONFIDENTIEL CONFIDENTIEL >> $HOME/.config/gtk-3.0/bookmarks
;;
"direction")
mkdir -p $HOME/Documents/01-$SCOPE1
mkdir -p $HOME/Documents/02-$SCOPE2
mkdir -p $HOME/Documents/03-$SCOPE3
ln -sf $SHARE_DIR/01-$SCOPE1/ELEVES $HOME/Documents/01-$SCOPE1/ELEVES
ln -sf $SHARE_DIR/01-$SCOPE1/PROFESSEURS $HOME/Documents/01-$SCOPE1/PROFESSEURS
ln -sf $SHARE_DIR/02-$SCOPE2/ELEVES $HOME/Documents/02-$SCOPE2/ELEVES
ln -sf $SHARE_DIR/02-$SCOPE2/PROFESSEURS $HOME/Documents/02-$SCOPE2/PROFESSEURS
ln -sf $SHARE_DIR/03-$SCOPE3/ELEVES $HOME/Documents/03-$SCOPE3/ELEVES
ln -sf $SHARE_DIR/03-$SCOPE3/PROFESSEURS $HOME/Documents/03-$SCOPE3/PROFESSEURS
ln -sf $SHARE_DIR/SCAN $HOME/Documents/SCAN
ln -sf $SHARE_DIR/CONFIDENTIEL_DIRECTION $HOME/Documents/CONFIDENTIEL_DIRECTION
ln -sf $SHARE_DIR/CONFIDENTIEL_PROFESSEURS $HOME/Documents/CONFIDENTIEL_PROFESSEURS
echo file://$SHARE_DIR/01-$SCOPE1/ELEVES 01-$SCOPE1/ELEVES > $HOME/.config/gtk-3.0/bookmarks
echo file://$SHARE_DIR/01-$SCOPE1/PROFESSEURS 01-$SCOPE1/PROFESSEURS >> $HOME/.config/gtk-3.0/bookmarks
echo file://$SHARE_DIR/02-$SCOPE2/ELEVES 02-$SCOPE2/ELEVES >> $HOME/.config/gtk-3.0/bookmarks
echo file://$SHARE_DIR/02-$SCOPE2/PROFESSEURS 02-$SCOPE2/PROFESSEURS >> $HOME/.config/gtk-3.0/bookmarks
echo file://$SHARE_DIR/03-$SCOPE3/ELEVES 03-$SCOPE3/ELEVES >> $HOME/.config/gtk-3.0/bookmarks
echo file://$SHARE_DIR/03-$SCOPE3/PROFESSEURS 03-$SCOPE3/PROFESSEURS >> $HOME/.config/gtk-3.0/bookmarks
echo file://$SHARE_DIR/SCAN SCAN >> $HOME/.config/gtk-3.0/bookmarks
echo file://$SHARE_DIR/CONFIDENTIEL_DIRECTION CONFIDENTIEL_DIRECTION >> $HOME/.config/gtk-3.0/bookmarks
echo file://$SHARE_DIR/CONFIDENTIEL_PROFESSEURS CONFIDENTIEL_PROFESSEURS >> $HOME/.config/gtk-3.0/bookmarks
mkdir -p $DOCUMENTS/01-$SCOPE1
mkdir -p $DOCUMENTS/02-$SCOPE2
mkdir -p $DOCUMENTS/03-$SCOPE3
ln -sf $SHARE_DIR/01-$SCOPE1/ELEVES $DOCUMENTS/01-$SCOPE1/ÉLÈVES
ln -sf $SHARE_DIR/01-$SCOPE1/PROFESSEURS $DOCUMENTS/01-$SCOPE1/PROFESSEURS
ln -sf $SHARE_DIR/02-$SCOPE2/ELEVES $DOCUMENTS/02-$SCOPE2/ÉLÈVES
ln -sf $SHARE_DIR/02-$SCOPE2/PROFESSEURS $DOCUMENTS/02-$SCOPE2/PROFESSEURS
ln -sf $SHARE_DIR/03-$SCOPE3/ELEVES $DOCUMENTS/03-$SCOPE3/ÉLÈVES
ln -sf $SHARE_DIR/03-$SCOPE3/PROFESSEURS $DOCUMENTS/03-$SCOPE3/PROFESSEURS
ln -sf $SHARE_DIR/SCAN $DOCUMENTS/SCAN
ln -sf $SHARE_DIR/CONFIDENTIEL_DIRECTION $DOCUMENTS/CONFIDENTIEL_DIRECTION
ln -sf $SHARE_DIR/CONFIDENTIEL_PROFESSEURS $DOCUMENTS/CONFIDENTIEL_PROFESSEURS
echo file://$DOCUMENTS/01-$SCOPE1 01-$SCOPE1 > $HOME/.config/gtk-3.0/bookmarks
echo file://$DOCUMENTS/02-$SCOPE2 02-$SCOPE2 >> $HOME/.config/gtk-3.0/bookmarks
echo file://$DOCUMENTS/03-$SCOPE3 03-$SCOPE3 >> $HOME/.config/gtk-3.0/bookmarks
echo file://$DOCUMENTS/SCAN SCAN >> $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
;;
esac
esac
\ No newline at end of file
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