This reverts some changes the the "update_jailconf" function.
The reason behind this revert is that if a jail somehow has the same name as a directory, then the previous commit would have changed the directory name as well, which would break stuff.
The current code avoids all that and only replaces the necessary jail name value.
The support for the `--xz` option is only for ZFS at the moment since the `import` command assumes that was the case. By now just show a more descriptive message if `--xz` was used on a UFS system.
- check that bastille.conf exists or create a copy from .sample,
- changed "bastille0" loopback creation to read config value $bastille_network_loopback instead,
- changed setup.sh argument "bastille0" for loopback interface creation to a more generic "network",
- "bastille0" as a setup.sh argument is left for backwards compatibility
- fixed cloning of VNET bridged jails
- added support for regenerating static MAC on cloned jails
- simplified some sed commands to edit cloned jail.conf file
Tested with bridged VNET, VNET, and loopback jails
Current implementation allows for cloning jails that were created using a static MAC.
Also removed some unnecessary sed strings. These were simplified.
This commit will generate a static MAC address for each jail, based on the name of the jail. It will use the first half (xx:xx:xx) of the host MAC to avoid network clashes, and generate a random HEX string from the hashed name of the jail. It will then add that random 5 character HEX string in MAC format, and add an "a" and "b" for the host and jail respectively.
This way a jail can retain it's MAC ID even if it is deleted and reinstalled, as long as the same name is retained.
When a VNET jail has more than IP address configured on its primary interface, invoking "bastille list -a" will now display all addresses vertically aligned.
Hierarchical jails inherit the parent jail's permissions and don't support setting devfs_ruleset to a non-zero value. This update adds a check to determine if the script is running inside a jail. If so, it sets devfs_ruleset to 0 to comply with this constraint.