Ignore:
Timestamp:
Oct 6, 2012, 5:25:43 AM (12 years ago)
Author:
Bruno Cornec
Message:
  • Fix #622: Adds swaplabel support if it exists
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/mondo/src/restore-scripts/mondo/label-partitions-as-necessary

    r3008 r3040  
    4242            if [ "$opttun" = "-U" ]; then
    4343                LogIt "Creating uuid $label on swap partition $mountpt"
    44                 echo -n "$label" | perl -ne 's/-//g;chomp;print pack "H*",$_' | dd conv=notrunc "of=$mountpt" obs=1 seek=1036
     44                if [ -x "/sbin/swaplabel" ]; then
     45                    /sbin/swaplabel $opttun $label $mountpt
     46                else
     47                    echo -n "$label" | perl -ne 's/-//g;chomp;print pack "H*",$_' | dd conv=notrunc "of=$mountpt" obs=1 seek=1036
     48                fi
    4549            else
    46                 command="mkswap $opttun $label $mountpt"
     50                if [ -x "/sbin/swaplabel" ]; then
     51                    command="/sbin/swaplabel $opttun $label $mountpt"
     52                else
     53                    command="mkswap $opttun $label $mountpt"
     54                fi
    4755                LogIt "Running $command"
    4856                $command
Note: See TracChangeset for help on using the changeset viewer.