mirror of
https://github.com/hackacad/bastille.git
synced 2025-12-22 18:21:53 +01:00
Merge pull request #62 from cedwards/bugfixes
bugfixes for 0.4.20191025
This commit is contained in:
@@ -456,3 +456,9 @@ network)
|
|||||||
usage
|
usage
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
if [ ! -z "${2}" ]; then
|
||||||
|
if [ "${2}" = 'update' ]; then
|
||||||
|
bastille update "${RELEASE}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user