#! /bin/sh jailName="$1" mkdir -p /jails/$jailName if zfs list zroot/jails/$jailName then echo " Dataset $jailName already exists !" exit else ls -al /usr/freebsd-dist/MANIFEST echo "I will install freeBSD version which was issued by the day the file above was last changed." read -p "If you want to instlal newer version, remove the content of dirctory /usr/freebsd-dist/ before continuing. " REPLY zfs create -o mountpoint=/jails/$jailName zroot/jails/$jailName # zfs set recordsize=8K zroot/jails/$jailName cd /jails/$jailName # adresář rootfs to samo vytvoří bsdinstall jail rootfs datum=`date "+%Y-%m-%d %H:%M:%S"` printf "$jailName{\n\$note = \"Created $datum\";\n\$ip = \"192.168.144.XXX/24\";\n}">/jails/$jailName/c.conf echo "Doing update patches" freebsd-update -b /jails/$jailName/rootfs fetch freebsd-update -b /jails/$jailName/rootfs install echo "Do not forget to change ip adress in /jails/$jailName/c.conf" echo "Remember to setup firewall." echo "Install apps for example by \"pkg install screen vim mc\" inside." fi