Merge branch 'master' into debian

This commit is contained in:
Victor LABORIE 2017-03-31 14:55:52 +02:00
commit b151ef1145
2 changed files with 15 additions and 8 deletions

15
bkctld
View file

@ -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"
}

View file

@ -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