Browse Source

[MODULES] Minor logic changes in modules

DSR! 2 years ago
parent
commit
9b9195e528

+ 1 - 1
modules/src/PMKIDAttack/api/module.php

@@ -204,7 +204,7 @@ class PMKIDAttack extends Module
         $command = "{$hcxdumptoolPath} -o {$capPath} -i {$interface} --filterlist_ap={$filterPath} --filtermode=2 --enable_status=1";
         $this->execBackground($command);
         $this->addLog("Start attack {$bssid}");
-        //$this->addLog($command);
+        $this->addLog($command);
 
         $this->response = ["success" => true];
     }

+ 6 - 1
modules/src/PMKIDAttack/scripts/dependencies.sh

@@ -46,18 +46,21 @@ touch /tmp/PMKIDAttack.progress
 if [[ "$1" = "install" ]]; then
     opkg update
 
-    if [[ $(/bin/mount | /bin/grep "on /sd") ]]; then
+    check_sd=$(/bin/mount | /bin/grep "on /sd")    
+    if [[ -e /sd ]] && [[ -n "$check_sd" ]]; then
         add_log "Installing on sd"
 
         opkg --dest sd install $HCXTOOLS_IPK >> $LOGFILE
         if [[ $? -ne 0 ]]; then
             add_log "ERROR: opkg --dest sd install $HCXTOOLS_IPK failed"
+            rm /tmp/PMKIDAttack.progress
             exit 1
         fi
 
         opkg --dest sd install $HCXDUMPTOOL_IPK >> $LOGFILE
         if [[ $? -ne 0 ]]; then
             add_log "ERROR: opkg --dest sd install $HCXDUMPTOOL_IPK failed"
+            rm /tmp/PMKIDAttack.progress
             exit 1
         fi
     else
@@ -66,12 +69,14 @@ if [[ "$1" = "install" ]]; then
         opkg install $HCXTOOLS_IPK >> $LOGFILE
         if [[ $? -ne 0 ]]; then
             add_log "ERROR: opkg install $HCXTOOLS_IPK failed"
+            rm /tmp/PMKIDAttack.progress
             exit 1
         fi
 
         opkg install $HCXDUMPTOOL_IPK >> $LOGFILE
         if [[ $? -ne 0 ]]; then
             add_log "ERROR: opkg install $HCXDUMPTOOL_IPK failed"
+            rm /tmp/PMKIDAttack.progress
             exit 1
         fi
     fi

+ 2 - 1
modules/src/Terminal/scripts/dependencies.sh

@@ -23,7 +23,8 @@ touch /tmp/terminal.progress
 if [[ "$1" = "install" ]]; then
     opkg update
 
-    if [[ $(/bin/mount | /bin/grep "on /sd") ]]; then
+    check_sd=$(/bin/mount | /bin/grep "on /sd")    
+    if [[ -e /sd ]] && [[ -n "$check_sd" ]]; then
         add_log "Installing on sd"
 
         opkg --dest sd install ttyd >> $LOGFILE