mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
create_local_directories in soup too
This commit is contained in:
@@ -179,6 +179,21 @@ copy_new_files() {
|
|||||||
cd /tmp
|
cd /tmp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
create_local_directories() {
|
||||||
|
info "Creating local pillar and salt directories if needed"
|
||||||
|
PILLARSALTDIR=$1
|
||||||
|
for i in "pillar" "salt"; do
|
||||||
|
for d in $(find $PILLARSALTDIR/$i -type d); do
|
||||||
|
suffixdir=${d//$PILLARSALTDIR/}
|
||||||
|
if [ ! -d "$local_salt_dir/$suffixdir" ]; then
|
||||||
|
logCmd "mkdir -pv $local_salt_dir$suffixdir"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
logCmd "chown -R socore:socore $local_salt_dir/$i"
|
||||||
|
done
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
disable_fastestmirror() {
|
disable_fastestmirror() {
|
||||||
sed -i 's/enabled=1/enabled=0/' /etc/yum/pluginconf.d/fastestmirror.conf
|
sed -i 's/enabled=1/enabled=0/' /etc/yum/pluginconf.d/fastestmirror.conf
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1026,6 +1026,7 @@ main() {
|
|||||||
backup_old_states_pillars
|
backup_old_states_pillars
|
||||||
fi
|
fi
|
||||||
copy_new_files
|
copy_new_files
|
||||||
|
create_local_directories "/opt/so/saltstack/default"
|
||||||
apply_hotfix
|
apply_hotfix
|
||||||
echo "Hotfix applied"
|
echo "Hotfix applied"
|
||||||
update_version
|
update_version
|
||||||
@@ -1092,6 +1093,7 @@ main() {
|
|||||||
echo "Copying new Security Onion code from $UPDATE_DIR to $DEFAULT_SALT_DIR."
|
echo "Copying new Security Onion code from $UPDATE_DIR to $DEFAULT_SALT_DIR."
|
||||||
copy_new_files
|
copy_new_files
|
||||||
echo ""
|
echo ""
|
||||||
|
create_local_directories "/opt/so/saltstack/default"
|
||||||
update_version
|
update_version
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
|
|||||||
@@ -762,21 +762,6 @@ copy_salt_master_config() {
|
|||||||
logCmd "systemctl restart salt-master"
|
logCmd "systemctl restart salt-master"
|
||||||
}
|
}
|
||||||
|
|
||||||
create_local_directories() {
|
|
||||||
info "Creating local pillar and salt directories"
|
|
||||||
PILLARSALTDIR=${SCRIPTDIR::-5}
|
|
||||||
for i in "pillar" "salt"; do
|
|
||||||
for d in $(find $PILLARSALTDIR/$i -type d); do
|
|
||||||
suffixdir=${d//$PILLARSALTDIR/}
|
|
||||||
if [ ! -d "$local_salt_dir/$suffixdir" ]; then
|
|
||||||
logCmd "mkdir -pv $local_salt_dir$suffixdir"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
logCmd "chown -R socore:socore $local_salt_dir/$i"
|
|
||||||
done
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
create_local_nids_rules() {
|
create_local_nids_rules() {
|
||||||
title "Create a local.rules file so it doesn't get removed on updates"
|
title "Create a local.rules file so it doesn't get removed on updates"
|
||||||
logCmd "mkdir -p /opt/so/saltstack/local/salt/idstools"
|
logCmd "mkdir -p /opt/so/saltstack/local/salt/idstools"
|
||||||
|
|||||||
@@ -672,7 +672,7 @@ if ! [[ -f $install_opt_file ]]; then
|
|||||||
# Add the socore user
|
# Add the socore user
|
||||||
add_socore_user_manager
|
add_socore_user_manager
|
||||||
|
|
||||||
create_local_directories
|
create_local_directories ${SCRIPTDIR::-5}
|
||||||
setup_salt_master_dirs
|
setup_salt_master_dirs
|
||||||
create_manager_pillars
|
create_manager_pillars
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user