-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from arrase/split
Split
- Loading branch information
Showing
6 changed files
with
34 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/python | ||
|
||
import argparse | ||
|
||
from RaspiDucky.Daemonize import Daemonize | ||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument('--start', help='Start Server', action="store_true") | ||
parser.add_argument('--stop', help='Stop Server', action="store_true") | ||
parser.add_argument('--restart', help='Restart Server', action="store_true") | ||
|
||
args = parser.parse_args() | ||
|
||
daemon = Daemonize() | ||
|
||
if args.start: | ||
daemon.start() | ||
elif args.stop: | ||
daemon.stop() | ||
elif args.restart: | ||
daemon.restart() | ||
else: | ||
parser.print_help() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,16 @@ | ||
#!/usr/bin/python | ||
|
||
import argparse | ||
import sys | ||
|
||
from RaspiDucky.Daemonize import Daemonize | ||
from RaspiDucky.RunPayload import RunPayload | ||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument('--payload', '-p', required=False, help='Path to payload file') | ||
parser.add_argument('--payload', '-p', required=True, help='Path to payload file') | ||
parser.add_argument('--remote', '-r', required=False, help='Run payload on remote device', action="store_true") | ||
parser.add_argument('--address', '-a', required=False, help='Remote device address') | ||
parser.add_argument('--daemon', '-d', choices=['start', 'stop', 'restart'], required=False, | ||
help='Run as daemon') | ||
|
||
args = parser.parse_args() | ||
|
||
if args.daemon is not None: | ||
daemon = Daemonize() | ||
if args.daemon == 'restart': | ||
daemon.restart() | ||
elif args.daemon == 'stop': | ||
daemon.stop() | ||
else: | ||
daemon.start() | ||
elif args.payload is not None: | ||
ducky = RunPayload() | ||
ducky.run(payload=args.payload, remote=args.remote, address=args.address) | ||
else: | ||
parser.print_help() | ||
sys.exit(1) | ||
ducky = RunPayload() | ||
ducky.run(payload=args.payload, remote=args.remote, address=args.address) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters