Index: bin/diskimg-manage =================================================================== --- bin/diskimg-manage (revision 123) +++ bin/diskimg-manage (working copy) @@ -32,12 +32,13 @@ qemu-img create -f $imgtype $imgfile $imgsize # windows wants the partition on disk parted -s $imgfile mklabel msdos - parted -a opt -s -- $imgfile mkpart primary fat32 0 -0 + parted -s -- $imgfile mkpart primary fat32 0 -0 part_offset=$( parted -s $imgfile unit B print | sed -n 's/\s*1\s*\([0-9]\+\)B\s*[0-9]\+B.*/\1/p' ) # # this part requeres root proveledges # - loopdev=$( losetup -f --show -o $part_offset $imgfile ) + loopdev=$( losetup -f ) + losetup -o $part_offset $loopdev $imgfile if [ "$fstype" = "vfat" ]; then # TODO: ext3 support? mkdosfs -F32 -n DATA $loopdev @@ -56,7 +57,8 @@ local datadir=$2 part_offset=$( parted -s $imgfile unit B print | sed -n 's/\s*1\s*\([0-9]\+\)B\s*[0-9]\+B.*/\1/p' ) - loopdev=$( losetup -f --show -o $part_offset $imgfile ) + loopdev=$( losetup -f ) + losetup -o $part_offset $loopdev $imgfile mountpoint="${datadir}-img" mkdir -p $mountpoint mkdir -p $datadir Index: rainbow-GW-helper/libiptables.sh =================================================================== --- rainbow-GW-helper/libiptables.sh (revision 123) +++ rainbow-GW-helper/libiptables.sh (working copy) @@ -7,12 +7,12 @@ check_rainbow_rules () { iptables -t nat -n --list RAINBOW >/dev/null 2>&1 || return 1 - iptables -t nat -S PREROUTING | grep -q RAINBOW || return 1 + iptables-save -t nat | grep PREROUTING | grep -q RAINBOW || return 1 return 0 } cleanup_rainbow_rules () { - iptables -t nat -S PREROUTING | grep RAINBOW | sed 's/^-A/-D/' | xargs -r iptables -t nat + iptables-save -t nat | grep PREROUTING | grep RAINBOW | sed 's/^-A/-D/' | xargs -r iptables -t nat iptables -t nat -F RAINBOW >/dev/null 2>&1 iptables -t nat -X RAINBOW >/dev/null 2>&1 } @@ -27,7 +27,7 @@ get_next_fwd_port () { nextport=${FWD_START_PORT} - for port in $( iptables -t nat -S RAINBOW | sed -n 's/.*--dport\s\+\([0-9]\+\)\s\+-j\sDNAT.*/\1/p' | sort -n ); do + for port in $( iptables-save -t nat | grep -- '-A RAINBOW' | sed -n 's/.*--dport\s\+\([0-9]\+\)\s\+-j\sDNAT.*/\1/p' | sort -n ); do [ $nextport -lt $port ] && break nextport=$((port+1)) done Index: rainbow-GW-helper/libmail.sh =================================================================== --- rainbow-GW-helper/libmail.sh (revision 140) +++ rainbow-GW-helper/libmail.sh (working copy) @@ -11,7 +11,7 @@ shift local subject="Rainbow job $jobstate: $jobid" body_template="${jobstate}_TEXT" - printf "${!body_template}\n" $* | mail -s "$subject" -r $RAINBOW_MAILFROM "$rcptto" + printf "${!body_template}\n" $* | mail -s "$subject" "$rcptto" -- -f $RAINBOW_MAILFROM } PREPARED_TEXT="Dear, user!