Changeset 2799


Ignore:
Timestamp:
Nov 9, 2016, 1:05:48 PM (3 years ago)
Author:
daduve
Message:

Fix bug in umount home-linker

Location:
home-linker/trunk/fuentes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • home-linker/trunk/fuentes/debian/changelog

    r2786 r2799  
     1home-linker (0.60) xenial; urgency=high
     2
     3  * Fix bug in umount home-linker
     4
     5 -- Daniel Duran Vecino <daduve@gmail.com>  Wed, 09 Nov 2016 13:04:48 +0100
     6
    17home-linker (0.59) xenial; urgency=high
    28
  • home-linker/trunk/fuentes/home-linker.install/usr/sbin/home-linker

    r2785 r2799  
    77LOG="/var/log/home_linker.log"
    88echo "" > "$LOG"
     9echo "******************************" >> "$LOG"
     10echo "WELOCOME TO HOME-LINKER LOG" >> "$LOG"
     11echo "" >> "$LOG"
     12date >> "$LOG"
     13echo "******************************" >> "$LOG"
     14echo "" >> "$LOG"
    915echo "Username -> $1" >> "$LOG"
    1016
     
    9096
    9197# Umount directories mounted previously
    92 LIST_BIND_MOUNTED="$(mount | grep /net | cut -d ' ' -f3 | tr '\n' ' ')"
     98NEEDLE="${DESKTOP_LOCALE}|${DOCUMENTS_LOCALE}|${SHARE_LOCALE}|${SHARETEACHERS_LOCALE}|${GROUPSSHARE_LOCALE}|${DATA_ALUM}"
     99LIST_BIND_MOUNTED="$(mount | grep -E '/net|/server' | grep '/'$USER'/' | grep -E $NEEDLE | cut -d ' ' -f3 | tr '\n' ' ')"
    93100echo "" >> "$LOG"
    94101echo "     LIST MOUNTED POINTS AT LOGIN" >> "$LOG"
     
    215222if [ -d "/net/server-sync/home/$GRP_USER/$HL_USER/" ]; then
    216223    # other machines in aula
    217     echo "OTHER MACHINES IN AULA" >> "$LOG"
    218     [ "${DESKTOP_LOCALE}" = "" ] || mount --bind /net/server-sync/home/$GRP_USER/$HL_USER/Desktop $HL_HOME/${DESKTOP_LOCALE} || true
    219     [ "${DOCUMENTS_LOCALE}" = "" ] || mount --bind /net/server-sync/home/$GRP_USER/$HL_USER/Documents $HL_HOME/${DOCUMENTS_LOCALE} || true
    220     [ "${SHARE_LOCALE}" = "" ] || mount --bind /net/server-sync/share $HL_HOME/${SHARE_LOCALE} || true
     224    echo " THIN CLIENT TO MOUNT" >> "$LOG"
     225    echo "----------------------" >> "$LOG"
     226    echo "MOUNTING ${DESKTOP_LOCALE}" >> "$LOG"
     227    [ "${DESKTOP_LOCALE}" = "" ] || mount --bind /net/server-sync/home/$GRP_USER/$HL_USER/Desktop $HL_HOME/${DESKTOP_LOCALE} 1>> $LOG 2>>$LOG || true
     228    echo "MOUNTING ${DOCUMENTS_LOCALE}" >> "$LOG"
     229    [ "${DOCUMENTS_LOCALE}" = "" ] || mount --bind /net/server-sync/home/$GRP_USER/$HL_USER/Documents $HL_HOME/${DOCUMENTS_LOCALE} 1>> $LOG 2>>$LOG  || true
     230    echo "MOUNTING ${SHARE_LOCALE}" >> "$LOG"
     231    [ "${SHARE_LOCALE}" = "" ] || mount --bind /net/server-sync/share $HL_HOME/${SHARE_LOCALE} 1>> $LOG 2>>$LOG  || true
     232    if [ "$GRP_USER" = "teachers" ]; then
     233        # DELETE OLD DIRECTORIES FOR OTHER LANGUAGES
     234        for i in es_ES.UTF-8 ca_ES.UTF-8@Valencia ca_ES.UTF-8@valencia; do
     235                SHARETEACHERS_LOCALE_ERASE="$(/usr/bin/xdg_translator "$i"  "Teachers_Share")"
     236                if [ -d "$HL_HOME/$SHARETEACHERS_LOCALE_ERASE" ]; then
     237                        echo "Borrando $HL_HOME/$SHARETEACHERS_LOCALE_ERASE" >> "$LOG"
     238                        rm -d "$HL_HOME/$SHARETEACHERS_LOCALE_ERASE" >> "$LOG"
     239                fi
     240        done
     241        for i in es_ES.UTF-8 ca_ES.UTF-8@Valencia ca_ES.UTF-8@valencia; do
     242                DATA_ALUM_ERASE="$(/usr/bin/xdg_translator "$i"  "Data_Alum")"
     243                if [ -d "$HL_HOME/$DATA_ALUM_ERASE" ]; then
     244                        echo "Borrando $HL_HOME/$DATA_ALUM_ERASE" >> "$LOG"
     245                        rm -d "$HL_HOME/$DATA_ALUM_ERASE" >> "$LOG"
     246                fi
     247        done
     248       
     249       
     250        echo "MOUNTING ${SHARETEACHERS_LOCALE}" >> "$LOG"
     251        [ -d ${HL_HOME}/${SHARETEACHERS_LOCALE} ] || mkdir ${HL_HOME}/${SHARETEACHERS_LOCALE}
     252        [ "${SHARETEACHERS_LOCALE}" = "" ] || mount --bind /net/server-sync/teachers_share $HL_HOME/${SHARETEACHERS_LOCALE} 1>> $LOG 2>>$LOG || true
     253       
     254        echo "MOUNTING ${DATA_ALUM}" >> "$LOG"
     255        [ -d $HL_HOME/$DATA_ALUM ] || mkdir $HL_HOME/$DATA_ALUM
     256        [ "${DATA_ALUM}" = "" ]  || mount --bind /net/server-sync/home/students/ $HL_HOME/$DATA_ALUM 1>> $LOG 2>>$LOG || true
     257       
     258    fi
     259    echo "MOUNTING ${GROUPSSHARE_LOCALE}" >> "$LOG"
     260    [ "${GROUPSSHARE_LOCALE}" = "" ] || mount --bind /net/server-sync/groups_share $HL_HOME/${GROUPSSHARE_LOCALE} 1>> $LOG 2>>$LOG  || true
     261   
     262elif [ -d "/var/run/$HL_USER/home" ]; then
     263    #Fat clients
     264    echo " FATCLIENTS TO MOUNT" >> "$LOG"
     265    echo "----------------------" >> "$LOG"
     266    echo "MOUNTING ${DESKTOP_LOCALE}" >> "$LOG"
     267    [ "${DESKTOP_LOCALE}" = "" ] || mount --bind /run/$HL_USER/home/$GRP_USER/$HL_USER/Desktop $HL_HOME/${DESKTOP_LOCALE}1>> $LOG 2>>$LOG || true
     268    echo "MOUNTING ${DOCUMENTS_LOCALE}" >> "$LOG"
     269    [ "${DOCUMENTS_LOCALE}" = "" ] || mount --bind /run/$HL_USER/home/$GRP_USER/$HL_USER/Documents $HL_HOME/${DOCUMENTS_LOCALE} 1>> $LOG 2>>$LOG || true
     270    echo "MOUNTING ${SHARE_LOCALE}" >> "$LOG"
     271    [ "${SHARE_LOCALE}" = "" ] || mount --bind /run/$HL_USER/share $HL_HOME/${SHARE_LOCALE} 1>> $LOG 2>>$LOG || true
    221272    if [ "$GRP_USER" = "teachers" ]; then
    222273        # DELETE OLD DIRECTORIES FOR OTHER LANGUAGES
     
    228279                fi
    229280        done
    230         [ "${SHARETEACHERS_LOCALE}" = "" ] || mount --bind /run/$HL_USER/teachers_share $HL_HOME/${SHARETEACHERS_LOCALE} || true
    231281        for i in es_ES.UTF-8 ca_ES.UTF-8@Valencia ca_ES.UTF-8@valencia; do
    232282                DATA_ALUM_ERASE="$(/usr/bin/xdg_translator "$i"  "Data_Alum")"
     
    237287        done
    238288       
    239         [ "${DESKTOP_LOCALE}" = "" ] || mount --bind /net/server-sync/teachers_share $HL_HOME/${SHARETEACHERS_LOCALE} || true
     289        echo "MOUNTING ${SHARETEACHERS_LOCALE}" >> "$LOG"
     290        [ -d ${HL_HOME}/${SHARETEACHERS_LOCALE} ] || mkdir ${HL_HOME}/${SHARETEACHERS_LOCALE}
     291        [ "${SHARETEACHERS_LOCALE}" = "" ] || mount --bind /run/$HL_USER/teachers_share $HL_HOME/${SHARETEACHERS_LOCALE} 1>> $LOG 2>>$LOG || true
     292       
    240293        [ -d $HL_HOME/$DATA_ALUM ] || mkdir $HL_HOME/$DATA_ALUM
    241         mount --bind /net/server-sync/home/students/ $HL_HOME/$DATA_ALUM || true
    242     fi
    243     [ "${GROUPSSHARE_LOCALE}" = "" ] || mount --bind /net/server-sync/groups_share $HL_HOME/${GROUPSSHARE_LOCALE} || true
     294        [ "${DATA_ALUM}" = "" ]  || mount --bind /run/$HL_USER/home/students $HL_HOME/$DATA_ALUM || true
     295    fi
    244296   
    245 elif [ -d "/var/run/$HL_USER/home" ]; then
    246     #Fat clients
    247     echo "FATCLIENTS IN AULA" >> "$LOG"
    248     [ "${DESKTOP_LOCALE}" = "" ] || mount --bind /run/$HL_USER/home/$GRP_USER/$HL_USER/Desktop $HL_HOME/${DESKTOP_LOCALE} || true
    249     [ "${DOCUMENTS_LOCALE}" = "" ] || mount --bind /run/$HL_USER/home/$GRP_USER/$HL_USER/Documents $HLHOME/${DOCUMENTS_LOCALE} || true
    250     [ "${SHARE_LOCALE}" = "" ] || mount --bind /run/$HL_USER/share $HL_HOME/${SHARE_LOCALE} || true
    251     if [ "$GRP_USER" = "teachers" ]; then
    252         # DELETE OLD DIRECTORIES FOR OTHER LANGUAGES
    253         for i in es_ES.UTF-8 ca_ES.UTF-8@Valencia ca_ES.UTF-8@valencia; do
    254                 SHARETEACHERS_LOCALE_ERASE="$(/usr/bin/xdg_translator "$i"  "Teachers_Share")"
    255                 if [ -d $HL_HOME/$SHARETEACHERS_LOCALE_ERASE ]; then
    256                         echo "Borrando $HL_HOME/$SHARETEACHERS_LOCALE_ERASE" >> "$LOG"
    257                         rm -d $HL_HOME/$SHARETEACHERS_LOCALE_ERASE >> "$LOG"
    258                 fi
    259         done
    260         [ "${SHARETEACHERS_LOCALE}" = "" ] || mount --bind /run/$HL_USER/teachers_share $HL_HOME/${SHARETEACHERS_LOCALE} || true
    261         for i in es_ES.UTF-8 ca_ES.UTF-8@Valencia ca_ES.UTF-8@valencia; do
    262                 DATA_ALUM_ERASE="$(/usr/bin/xdg_translator "$i"  "Data_Alum")"
    263                 if [ -d $HL_HOME/$DATA_ALUM_ERASE ]; then
    264                         echo "Borrando $HL_HOME/$DATA_ALUM_ERASE" >> "$LOG"
    265                         rm -d $HL_HOME/$DATA_ALUM_ERASE >> "$LOG"
    266                 fi
    267         done
    268        
    269         [ "${SHARETEACHERS_LOCALE}" = "" ] || mount --bind /run/$HL_USER/teachers_share $HL_HOME/${SHARETEACHERS_LOCALE} || true
    270         [ -d $HL_HOME/$DATA_ALUM ] || mkdir $HL_HOME/$DATA_ALUM
    271         mount --bind /run/$HL_USER/home/students $HL_HOME/$DATA_ALUM || true
    272     fi
    273     [ "${GROUPSSHARE_LOCALE}" = "" ] || mount --bind /run/$HL_USER/groups_share $HL_HOME/${GROUPSSHARE_LOCALE} || true
     297   
     298    echo "MOUNTING ${GROUPSSHARE_LOCALE}" >> "$LOG"
     299    [ "${GROUPSSHARE_LOCALE}" = "" ] || mount --bind /run/$HL_USER/groups_share $HL_HOME/${GROUPSSHARE_LOCALE} 1>> $LOG 2>>$LOG || true
     300   
    274301fi
    275302mv ${TEMP_NEW_USER_DIRS} ${LAST_LOGIN_DIRECTORIES}
     
    291318chmod 600 "$USER_DIRS"
    292319chown $HL_USER:$GRP_USER "$USER_DIRS"
    293 
    294 date >> "$LOG"
     320echo "" >> "$LOG"
     321echo "******* MOUNT SCRIPT FINISHED - RESUME *****" >> "$LOG"
     322echo "--------------------------------------------" >> "$LOG"
     323echo "" >> "$LOG"
     324echo "lANGUAGE IS $AUX_LANG" >> "$LOG"
    295325echo "" >> "$LOG"
    296326echo "Las variables a tener en cuenta son:" >> "$LOG"
     
    300330echo "         \$DESKTOP_LOCALE -> $DESKTOP_LOCALE" >> "$LOG"
    301331echo "" >> "$LOG"
    302 echo "El idioma es $AUX_LANG" >> "$LOG"
    303 echo "" >> "$LOG"
    304 echo "AFTER HOME LINKER" >> "$LOG"
     332echo "----- HOME FROM USER AFTER HOME-LINKER ----" >> "$LOG"
    305333tree $HL_HOME >> "$LOG"
    306334echo "" >> "$LOG"
Note: See TracChangeset for help on using the changeset viewer.