Merge pull request #62 from cedwards/bugfixes

bugfixes for 0.4.20191025
This commit is contained in:
Christer Edwards
2019-11-20 20:02:09 -07:00
committed by GitHub
2 changed files with 16 additions and 10 deletions

View File

@@ -456,3 +456,9 @@ network)
usage usage
;; ;;
esac esac
if [ ! -z "${2}" ]; then
if [ "${2}" = 'update' ]; then
bastille update "${RELEASE}"
fi
fi

View File

@@ -108,14 +108,14 @@ 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}"
jexec -l ${_jail} /bin/sh < "${bastille_template_PRE}" jexec -l ${_jail} /bin/sh < "${bastille_template_PRE}" || exit 1
fi fi
## CONFIG / OVERLAY ## CONFIG / OVERLAY
if [ -s "${bastille_template_OVERLAY}" ]; then if [ -s "${bastille_template_OVERLAY}" ]; then
echo -e "${COLOR_GREEN}Copying files...${COLOR_RESET}" echo -e "${COLOR_GREEN}Copying files...${COLOR_RESET}"
while read _dir; do while read _dir; do
cp -a "${bastille_template}/${_dir}" "${bastille_jail_path}" cp -a "${bastille_template}/${_dir}" "${bastille_jail_path}" || exit 1
done < ${bastille_template_OVERLAY} done < ${bastille_template_OVERLAY}
echo -e "${COLOR_GREEN}Copy complete.${COLOR_RESET}" echo -e "${COLOR_GREEN}Copy complete.${COLOR_RESET}"
fi fi
@@ -123,7 +123,7 @@ for _jail in ${JAILS}; do
echo -e "${COLOR_YELLOW}CONFIG deprecated; rename to OVERLAY.${COLOR_RESET}" echo -e "${COLOR_YELLOW}CONFIG deprecated; rename to OVERLAY.${COLOR_RESET}"
echo -e "${COLOR_GREEN}Copying files...${COLOR_RESET}" echo -e "${COLOR_GREEN}Copying files...${COLOR_RESET}"
while read _dir; do while read _dir; do
cp -a "${bastille_template}/${_dir}" "${bastille_jail_path}" cp -a "${bastille_template}/${_dir}" "${bastille_jail_path}" || exit 1
done < ${bastille_template}/CONFIG done < ${bastille_template}/CONFIG
echo -e "${COLOR_GREEN}Copy complete.${COLOR_RESET}" echo -e "${COLOR_GREEN}Copy complete.${COLOR_RESET}"
fi fi
@@ -145,31 +145,31 @@ for _jail in ${JAILS}; do
## PKG (bootstrap + pkg) ## PKG (bootstrap + pkg)
if [ -s "${bastille_template_PKG}" ]; then if [ -s "${bastille_template_PKG}" ]; then
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 || exit 1
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 || exit 1
jexec -l "${_jail}" env ASSUME_ALWAYS_YES=YES /usr/sbin/pkg install $(cat ${bastille_template_PKG}) jexec -l "${_jail}" env ASSUME_ALWAYS_YES=YES /usr/sbin/pkg install $(cat ${bastille_template_PKG}) || exit 1
fi fi
## SYSRC ## SYSRC
if [ -s "${bastille_template_SYSRC}" ]; then if [ -s "${bastille_template_SYSRC}" ]; then
echo -e "${COLOR_GREEN}Updating services.${COLOR_RESET}" echo -e "${COLOR_GREEN}Updating services.${COLOR_RESET}"
while read _sysrc; do while read _sysrc; do
jexec -l ${_jail} /usr/sbin/sysrc "${_sysrc}" jexec -l ${_jail} /usr/sbin/sysrc "${_sysrc}" || exit 1
done < "${bastille_template_SYSRC}" done < "${bastille_template_SYSRC}"
fi fi
## SERVICE ## SERVICE
if [ -s "${bastille_template_SERVICE}" ]; then if [ -s "${bastille_template_SERVICE}" ]; then
echo -e "${COLOR_GREEN}Managing services.${COLOR_RESET}" echo -e "${COLOR_GREEN}Managing services.${COLOR_RESET}"
while read _sysrc; do while read _service; do
jexec -l ${_jail} /usr/sbin/service "${_sysrc}" jexec -l ${_jail} /usr/sbin/service ${_service} || exit 1
done < "${bastille_template_SERVICE}" done < "${bastille_template_SERVICE}"
fi fi
## CMD ## CMD
if [ -s "${bastille_template_CMD}" ]; then if [ -s "${bastille_template_CMD}" ]; then
echo -e "${COLOR_GREEN}Executing final command(s).${COLOR_RESET}" echo -e "${COLOR_GREEN}Executing final command(s).${COLOR_RESET}"
jexec -l ${_jail} /bin/sh < "${bastille_template_CMD}" jexec -l ${_jail} /bin/sh < "${bastille_template_CMD}" || exit 1
fi fi
echo -e "${COLOR_GREEN}Template Complete.${COLOR_RESET}" echo -e "${COLOR_GREEN}Template Complete.${COLOR_RESET}"
echo echo