0.3.2018112002 bugfix release
This commit is contained in:
@@ -28,14 +28,11 @@
|
|||||||
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
SAVED_TERM=$TERM
|
|
||||||
|
|
||||||
. /usr/local/share/bastille/colors.pre.sh
|
. /usr/local/share/bastille/colors.pre.sh
|
||||||
. /usr/local/etc/bastille/bastille.conf
|
. /usr/local/etc/bastille/bastille.conf
|
||||||
|
|
||||||
## version
|
## version
|
||||||
BASTILLE_VERSION="0.3.20181114"
|
BASTILLE_VERSION="0.3.20181120"
|
||||||
|
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
cat << EOF
|
cat << EOF
|
||||||
@@ -103,7 +100,6 @@ bootstrap|update|upgrade)
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
SCRIPTPATH="${bastille_sharedir}/${CMD}.sh"
|
SCRIPTPATH="${bastille_sharedir}/${CMD}.sh"
|
||||||
|
|
||||||
: ${UMASK:=022}
|
: ${UMASK:=022}
|
||||||
|
|||||||
@@ -126,8 +126,10 @@ create_jail() {
|
|||||||
if [ "${RELEASE}" == "11.2-RELEASE" ]; then cp -a "${bastille_releasesdir}/${RELEASE}/usr/tests" "${bastille_jail_path}"; fi
|
if [ "${RELEASE}" == "11.2-RELEASE" ]; then cp -a "${bastille_releasesdir}/${RELEASE}/usr/tests" "${bastille_jail_path}"; fi
|
||||||
|
|
||||||
## rc.conf.local & resolv.conf
|
## rc.conf.local & resolv.conf
|
||||||
|
## cron_flags="-J 60" ## cedwards 20181118
|
||||||
if [ ! -f "${bastille_jail_rc_conf}" ]; then
|
if [ ! -f "${bastille_jail_rc_conf}" ]; then
|
||||||
echo -e "syslogd_flags=\"-ss\"\nsendmail_enable=\"NONE\"" > ${bastille_jail_rc_conf}
|
echo -e "syslogd_flags=\"-ss\"\nsendmail_enable=\"NONE\"" > ${bastille_jail_rc_conf}
|
||||||
|
echo -e "cron_flags=\"-J 60\"" >> ${bastille_jail_rc_conf}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f "${bastille_jail_resolv_conf}" ]; then
|
if [ ! -f "${bastille_jail_resolv_conf}" ]; then
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
# https://pastebin.com/T6eThbKu
|
# https://pastebin.com/T6eThbKu
|
||||||
|
|
||||||
DEVICE_SELF_SCAN_ALL=NO
|
DEVICE_SELF_SCAN_ALL=NO
|
||||||
DIALOG_BACKTITLE="BastilleBSD"
|
|
||||||
DIALOG_TITLE="bootstrap"
|
|
||||||
[ "$_SCRIPT_SUBR" ] || . /usr/share/bsdconfig/script.subr
|
[ "$_SCRIPT_SUBR" ] || . /usr/share/bsdconfig/script.subr
|
||||||
usage(){ echo "Usage: ${0##*/} [-r releaseName] [dists ...]" >&2; exit 1; }
|
usage(){ echo "Usage: ${0##*/} [-r releaseName] [dists ...]" >&2; exit 1; }
|
||||||
while getopts hr: flag; do
|
while getopts hr: flag; do
|
||||||
@@ -24,13 +22,13 @@ REL_DIST=/usr/local/bastille/cache/$releaseName
|
|||||||
download() # $src to $dest
|
download() # $src to $dest
|
||||||
{
|
{
|
||||||
size=$( f_device_get device_media "$1" $PROBE_SIZE )
|
size=$( f_device_get device_media "$1" $PROBE_SIZE )
|
||||||
f_device_get device_media "$1" | dpv -kb "$DIALOG_BACKTITLE" \
|
f_device_get device_media "$1" | dpv -kb "BastilleBSD" \
|
||||||
-t "$DIALOG_TITLE" -p "Downloading $releaseName" \
|
-t "bootstrap" -p "Downloading $releaseName" \
|
||||||
-o "$3" "$size:$1"
|
-o "$3" "$size:$1"
|
||||||
}
|
}
|
||||||
sign() # $file
|
sign() # $file
|
||||||
{
|
{
|
||||||
dpv -kb "$DIALOG_BACKTITLE" -t "$DIALOG_TITLE" \
|
dpv -kb "BastilleBSD" -t "bootstrap" \
|
||||||
-p "Signing $releaseName" -mx "sha256 >&2" \
|
-p "Signing $releaseName" -mx "sha256 >&2" \
|
||||||
"$size:${1##*/}" "$1" 2>&1 >&$TERMINAL_STDOUT_PASSTHRU
|
"$size:${1##*/}" "$1" 2>&1 >&$TERMINAL_STDOUT_PASSTHRU
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,8 +63,7 @@ for _jail in ${JAILS}; do
|
|||||||
## pre
|
## pre
|
||||||
if [ -s "${bastille_template}/PRE" ]; then
|
if [ -s "${bastille_template}/PRE" ]; then
|
||||||
echo -e "${COLOR_GREEN}Executing PRE-command(s).${COLOR_RESET}"
|
echo -e "${COLOR_GREEN}Executing PRE-command(s).${COLOR_RESET}"
|
||||||
bastille_templatepre=$(cat "${bastille_template}/PRE")
|
jexec -l ${_jail} /bin/sh < "${bastille_template}/PRE"
|
||||||
jexec -l "${_jail}" /bin/sh "${bastille_templatepre}"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## config
|
## config
|
||||||
@@ -80,12 +79,14 @@ for _jail in ${JAILS}; do
|
|||||||
if [ -s "${bastille_template}/FSTAB" ]; then
|
if [ -s "${bastille_template}/FSTAB" ]; then
|
||||||
bastille_templatefstab=$(cat "${bastille_template}/FSTAB")
|
bastille_templatefstab=$(cat "${bastille_template}/FSTAB")
|
||||||
echo -e "${COLOR_GREEN}Updating fstab.${COLOR_RESET}"
|
echo -e "${COLOR_GREEN}Updating fstab.${COLOR_RESET}"
|
||||||
|
echo -e "${COLOR_GREEN}NOT YET IMPLEMENTED.${COLOR_RESET}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## pf
|
## pf
|
||||||
if [ -s "${bastille_template}/PF" ]; then
|
if [ -s "${bastille_template}/PF" ]; then
|
||||||
bastille_templatepf=$(cat "${bastille_template}/PF")
|
bastille_templatepf=$(cat "${bastille_template}/PF")
|
||||||
echo -e "${COLOR_GREEN}Generating PF profile.${COLOR_RESET}"
|
echo -e "${COLOR_GREEN}Generating PF profile.${COLOR_RESET}"
|
||||||
|
echo -e "${COLOR_GREEN}NOT YET IMPLEMENTED.${COLOR_RESET}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## pkg (bootstrap + pkg)
|
## pkg (bootstrap + pkg)
|
||||||
@@ -94,23 +95,23 @@ for _jail in ${JAILS}; do
|
|||||||
echo -e "${COLOR_GREEN}Installing packages.${COLOR_RESET}"
|
echo -e "${COLOR_GREEN}Installing packages.${COLOR_RESET}"
|
||||||
jexec -l ${_jail} env ASSUME_ALWAYS_YES="YES" /usr/sbin/pkg bootstrap
|
jexec -l ${_jail} env ASSUME_ALWAYS_YES="YES" /usr/sbin/pkg bootstrap
|
||||||
jexec -l ${_jail} env ASSUME_ALWAYS_YES="YES" /usr/sbin/pkg audit -F
|
jexec -l ${_jail} env ASSUME_ALWAYS_YES="YES" /usr/sbin/pkg audit -F
|
||||||
jexec -l ${_jail} env ASSUME_ALWAYS_YES="YES" /usr/sbin/pkg install -y ${bastille_templatepkg}
|
jexec -l ${_jail} env ASSUME_ALWAYS_YES="YES" /usr/sbin/pkg install ${bastille_templatepkg}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## sysrc
|
## sysrc
|
||||||
if [ -s "${bastille_template}/SYSRC" ]; then
|
if [ -s "${bastille_template}/SYSRC" ]; then
|
||||||
bastille_templatesys=$(cat "${bastille_template}/SYSRC")
|
|
||||||
echo -e "${COLOR_GREEN}Updating services.${COLOR_RESET}"
|
echo -e "${COLOR_GREEN}Updating services.${COLOR_RESET}"
|
||||||
jexec -l ${_jail} /usr/sbin/sysrc ${bastille_templatesys}
|
IFS=''
|
||||||
|
while read _sysrc; do
|
||||||
|
jexec -l ${_jail} /usr/sbin/sysrc "${_sysrc}"
|
||||||
|
done < "${bastille_template}/SYSRC"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## cmd
|
## cmd
|
||||||
if [ -s "${bastille_template}/CMD" ]; then
|
if [ -s "${bastille_template}/CMD" ]; then
|
||||||
bastille_templatecmd=$(cat "${bastille_template}/CMD")
|
|
||||||
echo -e "${COLOR_GREEN}Executing final command(s).${COLOR_RESET}"
|
echo -e "${COLOR_GREEN}Executing final command(s).${COLOR_RESET}"
|
||||||
jexec -l ${_jail} ${bastille_templatecmd}
|
jexec -l ${_jail} /bin/sh < "${bastille_template}/CMD"
|
||||||
fi
|
fi
|
||||||
echo -e "${COLOR_GREEN}Template Complete.${COLOR_RESET}"
|
echo -e "${COLOR_GREEN}Template Complete.${COLOR_RESET}"
|
||||||
echo
|
echo
|
||||||
echo
|
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ fi
|
|||||||
|
|
||||||
RELEASE=$1
|
RELEASE=$1
|
||||||
|
|
||||||
echo -e "${COLOR_RED}Targeting specified release.${COLOR_RESET}"
|
echo -e "${COLOR_GREEN}Targeting specified release.${COLOR_RESET}"
|
||||||
echo -e "${RELEASE}"
|
echo -e "${RELEASE}"
|
||||||
echo
|
echo
|
||||||
if [ -d "${bastille_releasesdir}/${RELEASE}" ]; then
|
if [ -d "${bastille_releasesdir}/${RELEASE}" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user