Fix intermittent 'like' failures; Ensure bash is on first line of load templates script

This commit is contained in:
Jason Ertel
2021-06-20 22:14:13 -04:00
parent 60fd3c6bd3
commit 777bece2eb
2 changed files with 5 additions and 5 deletions

View File

@@ -1,6 +1,3 @@
{%- set mainint = salt['pillar.get']('host:mainint') %}
{%- set MYIP = salt['grains.get']('ip_interfaces:' ~ mainint)[0] %}
#!/bin/bash #!/bin/bash
# Copyright 2014,2015,2016,2017,2018,2019 Security Onion Solutions, LLC # Copyright 2014,2015,2016,2017,2018,2019 Security Onion Solutions, LLC
# #
@@ -17,6 +14,9 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
{%- set mainint = salt['pillar.get']('host:mainint') %}
{%- set MYIP = salt['grains.get']('ip_interfaces:' ~ mainint)[0] %}
default_conf_dir=/opt/so/conf default_conf_dir=/opt/so/conf
ELASTICSEARCH_HOST="{{ MYIP }}" ELASTICSEARCH_HOST="{{ MYIP }}"
ELASTICSEARCH_PORT=9200 ELASTICSEARCH_PORT=9200

View File

@@ -201,7 +201,7 @@ function syncElastic() {
# Generate the new users file # Generate the new users file
echo "select '{\"user\":\"' || ici.identifier || '\", \"data\":' || ic.config || '}'" \ echo "select '{\"user\":\"' || ici.identifier || '\", \"data\":' || ic.config || '}'" \
"from identity_credential_identifiers ici, identity_credentials ic " \ "from identity_credential_identifiers ici, identity_credentials ic " \
"where ici.identity_credential_id=ic.id and ic.config like '%hashed_password%' " \ "where ici.identity_credential_id=ic.id and instr(ic.config, 'hashed_password') " \
"order by ici.identifier;" | \ "order by ici.identifier;" | \
sqlite3 "$databasePath" | \ sqlite3 "$databasePath" | \
jq -r '.user + ":" + .data.hashed_password' \ jq -r '.user + ":" + .data.hashed_password' \
@@ -212,7 +212,7 @@ function syncElastic() {
echo "select 'superuser:' || ici.identifier " \ echo "select 'superuser:' || ici.identifier " \
"from identity_credential_identifiers ici, identity_credentials ic " \ "from identity_credential_identifiers ici, identity_credentials ic " \
"where ici.identity_credential_id=ic.id and ic.config like '%hashed_password%' " \ "where ici.identity_credential_id=ic.id and instr(ic.config, 'hashed_password') " \
"order by ici.identifier;" | \ "order by ici.identifier;" | \
sqlite3 "$databasePath" \ sqlite3 "$databasePath" \
>> "$rolesTmpFile" >> "$rolesTmpFile"