      return parser.parse_args()
  
  def check_args(args):
-@@ -345,19 +361,21 @@
+@@ -345,19 +350,21 @@
      with open('/tmp/hostapd.conf', 'w') as dhcpconf:
              dhcpconf.write(config % (mon_iface, essid, channel))
  

+    APs = [[args.ap_ch, args.ap_essid, args.ap_bssid]]
+    channel, essid, ap_mac = APs[0]
+
+    # # Copy AP
+    # time.sleep(3)
+    # hop = Thread(target=channel_hop, args=(mon_iface,))
+    # hop.daemon = True
+    # hop.start()
+    # sniffing(mon_iface, targeting_cb)
+    # channel, essid, ap_mac = copy_AP()
+    # hop_daemon_running = False
 
     # get the correct template
     template = select_template(args.template)

 
 
 def dhcp_conf(interface):
@@ -739,6 +746,11 @@
     print "                      |_|                                "
     print "                                                         "
 
+    def raise_exception_sigint(self,signum, frame):
+        raise KeyboardInterrupt()
+    import signal
+    signal.signal(signal.SIGTERM, raise_exception_sigint)
+
     # Initialize a list to store the used interfaces
     used_interfaces = list()
 
@@ -789,7 +801,7 @@
             interfaces.IwconfigCmdError, interfaces.IfconfigCmdError) as err:
         print ("[{0}!{1}] " + str(err)).format(R, W)
         shutdown()
-
+    sys.stdout.flush()
     # add the selected interfaces to the used list
     used_interfaces = [mon_iface, ap_iface]
 
@@ -810,14 +822,11 @@
 
     print '[' + T + '*' + W + '] Cleared leases, started DHCP, set up iptables'
 
