Skip to content
This repository has been archived by the owner on Apr 19, 2021. It is now read-only.

Commit

Permalink
skip sosetup-network when passing from sosetup to sosetup-elastic
Browse files Browse the repository at this point in the history
  • Loading branch information
dougburks committed Aug 29, 2017
1 parent 0c69b0e commit e4e8f0b
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
securityonion-setup (20120912-0ubuntu0securityonion239) trusty; urgency=medium

* skip sosetup-network when passing from sosetup to sosetup-elastic

-- Doug Burks <[email protected]> Tue, 29 Aug 2017 12:41:41 -0400

securityonion-setup (20120912-0ubuntu0securityonion238) trusty; urgency=medium

* update for elastic
Expand Down
1 change: 1 addition & 0 deletions debian/patches/series
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,4 @@ Issue-1111:-so-allow-analyst-mode-should-add-IP-address-to-OSSEC-whitelist
inform-user-of-OSSEC-server-restart-for-so-disallow
so-allowdisallow:-fix-wrong-number-of-arguments-error
update-for-elastic
skip-sosetup-network-when-passing-from-sosetup-to-sosetup-elastic
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
Description: <short summary of the patch>
TODO: Put a short summary on the line above and replace this paragraph
with a longer explanation of this change. Complete the meta-information
with other relevant fields (see below for details). To make it easier, the
information below has been extracted from the changelog. Adjust it or drop
it.
.
securityonion-setup (20120912-0ubuntu0securityonion239) trusty; urgency=medium
.
* skip sosetup-network when passing from sosetup to sosetup-elastic
Author: Doug Burks <[email protected]>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- securityonion-setup-20120912.orig/bin/sosetup
+++ securityonion-setup-20120912/bin/sosetup
@@ -218,7 +218,7 @@ if [ $? = 1 ]; then
fi
[ "$SETUP" == "" ] && exit
if [ "$SETUP" == "Experimental Setup" ]; then
- /usr/sbin/sosetup-elastic
+ /usr/sbin/sosetup-elastic skipnetwork
exit $?
fi

--- securityonion-setup-20120912.orig/bin/sosetup-elastic
+++ securityonion-setup-20120912/bin/sosetup-elastic
@@ -139,6 +139,8 @@ HR_MEM=$((TOTAL_MEM / 1000))
MEM_TEXT="This machine currently has "$HR_MEM"GB of RAM allocated.\n\For best performance, please ensure the machine is allocated at least 3GB of RAM.\n\n\Please consult the following link for more information:\n\https://github.com/Security-Onion-Solutions/security-onion/wiki/Hardware\n\n\
Click 'No' to stop setup and adjust the amount of RAM allocated to this machine.\n\
Otherwise, click 'Yes' to continue."
+ARGS=("$@")
+
#########################################
# Debug
#########################################
@@ -196,11 +198,11 @@ fi
#########################################
# sosetup-network
#########################################
-if [ -z "$WRITEANSWERFILE" ]; then # Network config not yet supported when generating an answer file
-[ -f /usr/sbin/sosetup-network ] && /usr/sbin/sosetup-network
-ANSWER="$?"
-# If there were errors in sosetup-network, then exit
-[ $ANSWER -eq 1 ] && exit
+# Network config not yet supported when generating an answer file
+if [ -z "$WRITEANSWERFILE" ] && [ "${ARGS[0]}" != "skipnetwork" ] && [ -f /usr/sbin/sosetup-network ]; then
+ /usr/sbin/sosetup-network
+ # If there were errors in sosetup-network, then exit
+ [ $? -eq 1 ] && exit
fi

#########################################

0 comments on commit e4e8f0b

Please sign in to comment.