summaryrefslogtreecommitdiffstats
path: root/icons
Commit message (Collapse)AuthorAgeFilesLines
* update icons for MageiaAnne Nicolas2011-05-143-0/+0
|
* Synthesized commit during git-svn import combining previous Mandriva history ↵2.77.22Mageia SVN-Git Migration2011-05-143-0/+0
| | | | | | | | | | | | with Mageia. This commit consitsts of the following subversion commits: ------------------------------------------------------------------------ r1310 | dmorgan | 2011-05-14 01:22:07 +0100 (Sat, 14 May 2011) | 1 line Import cleaned mgaonline ------------------------------------------------------------------------
* - readded filesDaouda Lo2004-03-173-0/+0
|
* - remove old iconsDaouda Lo2004-03-173-0/+0
|
* - readded iconsDaouda Lo2004-02-183-0/+0
|
* - remove iconsDaouda Lo2004-02-183-0/+0
|
* New iconsDavid Baudens2002-07-313-0/+0
|
* add iconsDaouda Lo2001-09-043-0/+0
n77'>77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
#!/bin/bash

# import functions library
source rescue_common

tmpdir="/tmp/flash-rescue-root"
rootdir="$tmpdir/pen"

function prepare() {

    mkdir -p $rootdir

    if ! mount_usbroot $rootdir; then
        return 1
    fi

    if [ x"$version" = x"1.0" ]; then
        mkdir -p $tmpdir/shared
        if ! mount_sharedroot $tmpdir/shared; then
            return 1
        fi
    fi

    if [ ! -d $dir ]; then
        mkdir $dir
    fi

    return 0
}

function doit() {

    clear
    echo
    echo -n 'Creating backup file. This can take some time:  '

    bzip2 -c $loop > $target 2> /tmp/rescue-backup.err &

    sleep 2

    while ps | grep -q bzip2; do
        progress
    done

    sync

    echo
    echo

    errsize=$(ls -la /tmp/rescue-backup.err | cut -d' ' -f5)
    if [ $errsize -ne 0 ]; then
        echo "Error compressing user files into $target"
        return 1
    else
        echo 'Backup file created!'
    fi

    echo

    return 0
}

function cleanup() {

    if [ x"$version" = x"1.0" ]; then
        umount $tmpdir/shared > /dev/null 2>&1
        rmdir $tmpdir/shared
    fi

    umount $rootdir > /dev/null 2>&1
    rmdir $rootdir $tmpdir 2> /dev/null

    return 0
}

clear
trap cleanup SIGINT

version=""
if ! insert_pendrive; then
    exit 1
fi

if [ x"$version" = x"1.0" ]; then
    dir="$tmpdir/shared/backup"
    loop="$rootdir/loopbacks/system.loop"
else
    dir="$rootdir/backup"
    loop="$rootdir/.loopbacks/system.loop"
fi

file="backup-$(date +%Y%m%d).bz2"
target="$dir/$file"

if ! prepare; then
    cleanup
    exit 1
fi

if ! doit; then
    cleanup
    exit 1
fi

cleanup
exit 0