mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
Merge pull request #989 from Security-Onion-Solutions/feature/isosetup
Fix username so install works properly from ISO
This commit is contained in:
@@ -659,10 +659,10 @@ detect_os() {
|
|||||||
disable_auto_start() {
|
disable_auto_start() {
|
||||||
|
|
||||||
# Remove the automated setup script from crontab, if it exists
|
# Remove the automated setup script from crontab, if it exists
|
||||||
crontab -u $USER -r
|
crontab -u $INSTALLUSERNAME -r
|
||||||
|
|
||||||
# Truncate last line of the bash profile
|
# Truncate last line of the bash profile
|
||||||
sed -i '$ d' /home/$USER/.bash_profile
|
sed -i '$ d' /home/$INSTALLUSERNAME/.bash_profile
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1156,6 +1156,11 @@ elasticsearch_pillar() {
|
|||||||
cat "$pillar_file" >> "$setup_log" 2>&1
|
cat "$pillar_file" >> "$setup_log" 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
parse_install_username() {
|
||||||
|
# parse out the install username so things copy correctly
|
||||||
|
INSTALLUSERNAME=$(pwd | sed -E 's/\// /g' | awk '{ print $2 }')
|
||||||
|
}
|
||||||
|
|
||||||
patch_pillar() {
|
patch_pillar() {
|
||||||
|
|
||||||
local pillar_file=$temp_install_dir/pillar/minions/$MINION_ID.sls
|
local pillar_file=$temp_install_dir/pillar/minions/$MINION_ID.sls
|
||||||
@@ -1420,8 +1425,8 @@ setup_salt_master_dirs() {
|
|||||||
|
|
||||||
# Copy over the salt code and templates
|
# Copy over the salt code and templates
|
||||||
if [ "$setup_type" = 'iso' ]; then
|
if [ "$setup_type" = 'iso' ]; then
|
||||||
rsync -avh --exclude 'TRANS.TBL' /home/$USER/SecurityOnion/pillar/* $default_salt_dir/pillar/ >> "$setup_log" 2>&1
|
rsync -avh --exclude 'TRANS.TBL' /home/$INSTALLUSERNAME/SecurityOnion/pillar/* $default_salt_dir/pillar/ >> "$setup_log" 2>&1
|
||||||
rsync -avh --exclude 'TRANS.TBL' /home/$USER/SecurityOnion/salt/* $default_salt_dir/salt/ >> "$setup_log" 2>&1
|
rsync -avh --exclude 'TRANS.TBL' /home/$INSTALLUSERNAME/SecurityOnion/salt/* $default_salt_dir/salt/ >> "$setup_log" 2>&1
|
||||||
else
|
else
|
||||||
cp -R ../pillar/* $default_salt_dir/pillar/ >> "$setup_log" 2>&1
|
cp -R ../pillar/* $default_salt_dir/pillar/ >> "$setup_log" 2>&1
|
||||||
cp -R ../salt/* $default_salt_dir/salt/ >> "$setup_log" 2>&1
|
cp -R ../salt/* $default_salt_dir/salt/ >> "$setup_log" 2>&1
|
||||||
|
|||||||
@@ -47,6 +47,9 @@ while [[ $# -gt 0 ]]; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
# Begin Installation pre-processing
|
# Begin Installation pre-processing
|
||||||
|
parse_install_username
|
||||||
|
echo "Installing as the $INSTALLUSERNAME user." >> $setup_log 2>&1
|
||||||
|
|
||||||
echo "---- Starting setup at $(date -u) ----" >> $setup_log 2>&1
|
echo "---- Starting setup at $(date -u) ----" >> $setup_log 2>&1
|
||||||
|
|
||||||
automated=no
|
automated=no
|
||||||
|
|||||||
Reference in New Issue
Block a user