docker
parent
5c904aee8d
commit
6f3593510c
|
@ -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
16
empire
|
@ -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'
|
||||
|
|
Loading…
Reference in New Issue