mirror of
https://github.com/hackacad/bastille.git
synced 2025-12-20 01:02:36 +01:00
Add preliminary support for MidnightBSD.
This commit is contained in:
@@ -33,6 +33,7 @@ bastille_resolv_conf="/etc/resolv.conf" ## default
|
||||
## bootstrap urls
|
||||
bastille_url_freebsd="http://ftp.freebsd.org/pub/FreeBSD/releases/" ## default: "http://ftp.freebsd.org/pub/FreeBSD/releases/"
|
||||
bastille_url_hardenedbsd="http://installer.hardenedbsd.org/pub/hardenedbsd/" ## default: "https://installer.hardenedbsd.org/pub/HardenedBSD/releases/"
|
||||
bastille_url_midnightbsd="https://www.midnightbsd.org/ftp/MidnightBSD/releases/" ## default: "https://www.midnightbsd.org/pub/MidnightBSD/releases/"
|
||||
|
||||
## ZFS options
|
||||
bastille_zfs_enable="" ## default: ""
|
||||
|
||||
@@ -363,6 +363,13 @@ fi
|
||||
|
||||
## Filter sane release names
|
||||
case "${1}" in
|
||||
2.[0-9]*)
|
||||
## check for MidnightBSD releases name
|
||||
NAME_VERIFY=$(echo ${RELEASE})
|
||||
UPSTREAM_URL="${bastille_url_midnightbsd}${HW_MACHINE_ARCH}/${NAME_VERIFY}"
|
||||
PLATFORM_OS="MidnightBSD"
|
||||
validate_release_url
|
||||
;;
|
||||
*-CURRENT|*-current)
|
||||
## check for FreeBSD releases name
|
||||
NAME_VERIFY=$(echo "${RELEASE}" | grep -iwE '^([1-9]{2,2})\.[0-9](-CURRENT)$' | tr '[:lower:]' '[:upper:]')
|
||||
|
||||
@@ -481,6 +481,11 @@ fi
|
||||
if [ -z "${EMPTY_JAIL}" ]; then
|
||||
## verify release
|
||||
case "${RELEASE}" in
|
||||
2.[0-9]*)
|
||||
## check for MidnightBSD releases name
|
||||
NAME_VERIFY=$(echo "${RELEASE}")
|
||||
validate_release
|
||||
;;
|
||||
*-CURRENT|*-CURRENT-I386|*-CURRENT-i386|*-current)
|
||||
## check for FreeBSD releases name
|
||||
NAME_VERIFY=$(echo "${RELEASE}" | grep -iwE '^([1-9]{2,2})\.[0-9](-CURRENT|-CURRENT-i386)$' | tr '[:lower:]' '[:upper:]' | sed 's/I/i/g')
|
||||
|
||||
@@ -47,6 +47,10 @@ fi
|
||||
|
||||
for _jail in ${JAILS}; do
|
||||
info "[${_jail}]:"
|
||||
jexec -l "${_jail}" /usr/sbin/pkg "$@"
|
||||
if [ -f ${_jail}/usr/sbin/pkg ]; then
|
||||
jexec -l "${_jail}" /usr/sbin/pkg "$@"
|
||||
else
|
||||
jexec -l "${_jail}" /usr/sbin/mport "$@"
|
||||
fi
|
||||
echo
|
||||
done
|
||||
|
||||
@@ -64,6 +64,11 @@ if [ "${TARGET}" = "ALL" ]; then
|
||||
error_exit "Batch upgrade is unsupported."
|
||||
fi
|
||||
|
||||
if [ -f /bin/midnightbsd-version ]; then
|
||||
echo -e "${COLOR_RED}Not yet supported on MidnightBSD.${COLOR_RESET}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if freebsd-version | grep -qi HBSD; then
|
||||
error_exit "Not yet supported on HardenedBSD."
|
||||
fi
|
||||
|
||||
@@ -55,6 +55,11 @@ if [ "${TARGET}" = "ALL" ]; then
|
||||
error_exit "Batch upgrade is unsupported."
|
||||
fi
|
||||
|
||||
if [ -f /bin/midnightbsd-version ]; then
|
||||
echo -e "${COLOR_RED}Not yet supported on MidnightBSD.${COLOR_RESET}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if freebsd-version | grep -qi HBSD; then
|
||||
error_exit "Not yet supported on HardenedBSD."
|
||||
fi
|
||||
|
||||
@@ -36,6 +36,10 @@ bastille_usage() {
|
||||
}
|
||||
|
||||
verify_release() {
|
||||
if [ -f /bin/midnightbsd-version ]; then
|
||||
echo -e "${COLOR_RED}Not yet supported on MidnightBSD.${COLOR_RESET}"
|
||||
exit 1
|
||||
fi
|
||||
if freebsd-version | grep -qi HBSD; then
|
||||
error_exit "Not yet supported on HardenedBSD."
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user