mirror of
https://github.com/hackacad/bastille.git
synced 2025-12-21 17:52:01 +01:00
@@ -114,6 +114,18 @@ render() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
line_in_file() {
|
||||||
|
_line="${1}"
|
||||||
|
_file_path="${2}"
|
||||||
|
if [ -f "${_file_path}" ]; then
|
||||||
|
if ! grep -qxF "${_line}" "${_file_path}"; then
|
||||||
|
echo "${_line}" >> "${_file_path}"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
warn "Path not found for line_in_file: ${2}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Handle options.
|
# Handle options.
|
||||||
AUTO=0
|
AUTO=0
|
||||||
while [ "$#" -gt 0 ]; do
|
while [ "$#" -gt 0 ]; do
|
||||||
@@ -380,6 +392,10 @@ for _jail in ${JAILS}; do
|
|||||||
render "${bastille_jail_path}" "${_args}"
|
render "${bastille_jail_path}" "${_args}"
|
||||||
continue
|
continue
|
||||||
;;
|
;;
|
||||||
|
lif|lineinfile|line_in_file)
|
||||||
|
line_in_file "${_args}"
|
||||||
|
continue
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if ! eval "bastille ${_cmd} ${_jail} ${_args}"; then
|
if ! eval "bastille ${_cmd} ${_jail} ${_args}"; then
|
||||||
|
|||||||
Reference in New Issue
Block a user