Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds reset flag to Empire #145

Merged
merged 5 commits into from
Apr 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions empire
Original file line number Diff line number Diff line change
Expand Up @@ -1446,6 +1446,7 @@ if __name__ == '__main__':

generalGroup = parser.add_argument_group('General Options')
generalGroup.add_argument('--debug', nargs='?', const='1', help='Debug level for output (default of 1, 2 for msg display).')
generalGroup.add_argument('--reset-empire', action='store_true', help="Resets Empire's database to defaults.")
generalGroup.add_argument('-v', '--version', action='store_true', help='Display current Empire version.')
generalGroup.add_argument('-r','--resource', nargs=1, help='Run the Empire commands in the specified resource file after startup.')

Expand Down Expand Up @@ -1473,6 +1474,9 @@ if __name__ == '__main__':
if args.version:
print(empire.VERSION)

if args.reset_empire:
subprocess.call("./setup/reset.sh")

elif args.rest:
# start an Empire instance and RESTful API
main = empire.MainMenu(args=args)
Expand Down
7 changes: 0 additions & 7 deletions setup/reset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,3 @@ if [ -d ./downloads/ ]
then
rm -rf ./downloads/
fi

# start up Empire if not in docker otherwise return
if [ -f /.dockerenv ]; then
echo " [*] Empire reset complete returning back to Docker"
else
./empire
fi