mirror of
https://github.com/hackacad/bastille.git
synced 2025-12-19 00:30:05 +01:00
@@ -114,6 +114,18 @@ render() {
|
||||
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.
|
||||
AUTO=0
|
||||
while [ "$#" -gt 0 ]; do
|
||||
@@ -380,6 +392,10 @@ for _jail in ${JAILS}; do
|
||||
render "${bastille_jail_path}" "${_args}"
|
||||
continue
|
||||
;;
|
||||
lif|lineinfile|line_in_file)
|
||||
line_in_file "${_args}"
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
|
||||
if ! eval "bastille ${_cmd} ${_jail} ${_args}"; then
|
||||
|
||||
Reference in New Issue
Block a user