X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=handlers%2Fsys;h=ce9c5b03e2d523f267d950dc2186078c9e60aacf;hb=05c26446ed65681528387f6c66473c61eebe7224;hp=7c31780e77f78753b98ef63cfc4b2049380ca307;hpb=b2cda6aae39c0f67999f4b8c9b4aee93c207287e;p=matthijs%2Fupstream%2Fbackupninja.git diff --git a/handlers/sys b/handlers/sys index 7c31780..ce9c5b0 100755 --- a/handlers/sys +++ b/handlers/sys @@ -188,7 +188,7 @@ elif [ $os = "debian" ]; then echo "Level: $level" >> $sysreportfile for f in /etc/rc${level}.d/*; do # Remove /etc/Knn or Snn from beginning - ff=$(echo $f | sed 's_/etc/rc..d/[KS][0-9][0-9]__') + ff=$(echo $f | @SED@ 's_/etc/rc..d/[KS][0-9][0-9]__') if [ $f != $ff ]; then echo $ff >> $sysreportfile fi @@ -443,8 +443,7 @@ fi # these files can be used to directly partition a disk of the same size. if [ "$partitions" == "yes" ]; then - devices=`$SFDISK -l 2>/dev/null | grep "^Disk /dev" | awk '{print $2}' | cut -d: -f1` - debug "$SFDISK will try to backup partition tables for devices $devices" + devices=`$SFDISK -l 2>/dev/null | grep "^Disk /dev" | @AWK@ '{print $2}' | cut -d: -f1` if [ "$devices" == "" ]; then warning "No harddisks found" fi @@ -454,8 +453,11 @@ if [ "$partitions" == "yes" ]; then label=${dev#/dev/} label=${label//\//-} outputfile=${partitionsfile//__star__/$label} - debug "$SFDISK $sfdisk_options -d $dev > $outputfile" - $SFDISK $sfdisk_options -d $dev > $outputfile + debug "$SFDISK $sfdisk_options -d $dev > $outputfile 2>/dev/null" + $SFDISK $sfdisk_options -d $dev > $outputfile 2>/dev/null + if [ $? -ne 0 ]; then + warning "The partition table for $dev could not be saved." + fi done fi