diff --git a/bkctld b/bkctld index c60a7eb..e3e0b34 100755 --- a/bkctld +++ b/bkctld @@ -158,12 +158,14 @@ set_firewall() { if [ -f $FIREWALL_RULES ]; then sed -i "/#${jail}$/d" $FIREWALL_RULES fi - port=$(get_port $jail) - for ip in $(get_ip $jail); do - echo "/sbin/iptables -A INPUT -p tcp --sport 1024: --dport $port -s $ip -j ACCEPT #$jail" >> $FIREWALL_RULES - done - if [ -f /etc/init.d/minifirewall ]; then - /etc/init.d/minifirewall restart >/dev/null + if ( check_jail $jail ); then + port=$(get_port $jail) + for ip in $(get_ip $jail); do + echo "/sbin/iptables -A INPUT -p tcp --sport 1024: --dport $port -s $ip -j ACCEPT #$jail" >> $FIREWALL_RULES + done + if [ -f /etc/init.d/minifirewall ]; then + /etc/init.d/minifirewall restart >/dev/null + fi fi fi } @@ -284,6 +286,7 @@ sub_remove() { rm -rf ${JAILDIR}/${jail} echo "You need to purge ${INCDIR}/${jail} manually !" fi + set_firewall $jail echo "...OK" } diff --git a/docs/zzz_evobackup b/docs/zzz_evobackup index d319e24..099beae 100755 --- a/docs/zzz_evobackup +++ b/docs/zzz_evobackup @@ -135,8 +135,12 @@ mkdir -p -m 700 /home/backup ## Dump MBR / table partitions with dd and sfdisk ## Linux -# dd if=/dev/sda of=/home/backup/MBR bs=512 count=1 2>&1 | egrep -v "(records in|records out|512 bytes)" -# sfdisk -d /dev/sda > /home/backup/partitions 2>&1 | egrep -v "(Warning: extended partition does not start at a cylinder boundary|DOS and Linux will interpret the contents differently)" +#for disk in $(ls /dev/{s,v}d[a-z] 2>/dev/null); do +# name=$(basename $disk) +# dd if=$disk of=/home/backup/MBR-$name bs=512 count=1 2>&1 | egrep -v "(records in|records out|512 bytes)" +# fdisk -l $disk > /home/backup/partitions-$name +#done +#cat /home/backup/partitions-* > /home/backup/partitions ## OpenBSD # disklabel sd0 > /home/backup/partitions