readme-wiki
Alexander Rymdeko-Harvey 2017-12-20 08:59:14 -05:00
parent 5c904aee8d
commit 6f3593510c
2 changed files with 12 additions and 6 deletions

View File

@ -44,7 +44,7 @@ RUN apt-get update && apt-get install -qy \
sudo \
apt-utils \
lsb-core \
python2.7 \
python2.7
# cleanup image
RUN apt-get -qy clean \

16
empire
View File

@ -20,6 +20,16 @@ serverExitCommand = 'restart'
#
#####################################################
def database_check_docker():
"""
Check for docker and setup database if nessary.
"""
if os.path.exists('/.dockerenv'):
if not os.path.exists('data/empire.db'):
print '[*] Fresh start in docker, running reset.sh for you'
subprocess.call(['./setup/reset.sh']
def database_connect():
"""
Connect with the backend ./empire.db sqlite database and return the
@ -1325,11 +1335,7 @@ if __name__ == '__main__':
restGroup.add_argument('--password', nargs=1, help='Start the RESTful API with the specified password instead of pulling from empire.db')
args = parser.parse_args()
if os.path.exists('/.dockerenv'):
if not os.path.exists('data/empire.db'):
print '[*] Fresh start in docker, running reset.sh for you'
subprocess.call(['./setup/reset.sh']
database_check_docker()
if not args.restport:
args.restport = '1337'