Ignore:
Timestamp:
Jul 18, 2017, 1:41:09 PM (2 years ago)
Author:
joamuran
Message:

using getxpraConnections

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lmd/trunk/fuentes/lmd-server.install/usr/sbin/lmd-import-img.sh

    r4914 r5552  
    7575
    7676echo "[lmd Import] Extracting file..."
     77echo "[lmd Import] Extracting file... " > /tmp/importlog.txt
    7778tar -xvzf ${1} -C /tmp/extracted_image | zenity --progress --pulsate --auto-close --text "${MSG_EXTRACTING}" $ZEN_QUESTION
    7879
     
    8283fi
    8384
     85echo "[lmd Import] Extracted. No errors untaring. " >> /tmp/importlog.txt
     86
     87
    8488# Moving
    8589extracted_image=`ls /tmp/extracted_image/opt/ltsp/*/*.json | cut -d "/" -f 6`
    8690extracted_filename=`ls /tmp/extracted_image/opt/ltsp/*/*.json | cut -d "/" -f 7`
    8791new_imagename="${extracted_filename%.*}"
     92
     93echo "[lmd Import] Extracted image is  $extracted_image" >> /tmp/importlog.txt
    8894
    8995
     
    9298    zenity --question --text "${MSG_EXISTS_CHROOT}" $ZEN_QUESTION
    9399    if [ $? -eq  1 ]; then
     100        echo "[lmd Import] Cancelled. Image exists." >> /tmp/importlog.txt
    94101        exit -1
    95102    else
     103        echo "[lmd Import] Image already exists, but deleting that" >> /tmp/importlog.txt
    96104        rm -r /opt/ltsp/${new_imagename} | zenity --progress --auto-close --pulsate --text "${MSG_REMOVING}" $ZEN_QUESTION
    97105    fi
     
    102110echo "moving /opt/ltsp/${new_imagename}/${extracted_filename} to /etc/ltsp/images/"
    103111
     112echo "moving /tmp/extracted_image/opt/ltsp/${extracted_image} to /opt/ltsp/${new_imagename}"  >> /tmp/importlog.txt
     113echo "moving /opt/ltsp/${new_imagename}/${extracted_filename} to /etc/ltsp/images/"  >> /tmp/importlog.txt
     114
     115
    104116mv /tmp/extracted_image/opt/ltsp/${extracted_image}  /opt/ltsp/${new_imagename}
    105117mv /opt/ltsp/${new_imagename}/${extracted_filename}  /etc/ltsp/images/
    106118
    107119# Update kernels and regenerate image
     120echo "[lmd Import] Updating kernels into image" >> /tmp/importlog.txt
    108121ltsp-update-kernels ${new_imagename}
     122
     123echo "[lmd Import] Updating keys" >> /tmp/importlog.txt
    109124ltsp-update-sshkeys
     125
     126echo "[lmd Import] Update image" >> /tmp/importlog.txt
    110127ltsp-update-image ${new_imagename} | zenity --progress --pulsate --text "${MSG_CREATE_SQUASHFS}" $ZEN_QUESTION
    111 lmd-server.install/usr/sbin/lmd-import-img.sh
     128# WTF !!! lmd-server.install/usr/sbin/lmd-import-img.sh
    112129
    113130if [ $? -ne 0 ] ; then
     131echo "[lmd Import] Some error has success... updating image..." >> /tmp/importlog.txt
    114132zenity --error --text "${MSG_CANCELLED}" $ZEN_ERROR
    115133exit -1
     
    117135
    118136# Setting image into bootMenu
     137echo "[lmd Import] Pushing to boot list" >> /tmp/importlog.txt
    119138n4d-client -c LlxBootManager -m pushToBootList -u ${USER} -p ${PASS} -a ltp_label${new_imagename}
    120139 
    121140# Restarting NBD
     141echo "[lmd Import] Restarting NBD" >> /tmp/importlog.txt
    122142invoke-rc.d nbd-server restart
    123143
     144echo "[lmd Import] All worked fine" >> /tmp/importlog.txt
    124145zenity --info --text "${MSG_SUCCESS}" $ZEN_ERROR
    125146exit 0
Note: See TracChangeset for help on using the changeset viewer.