Link Search Menu Expand Document

WiFi Pineapple Python Command Helpers

Table of contents

  1. Introduction
  2. Functions

Introduction

Python API

Functions

def grep_output(command: str, grep_text: str, grep_options: List[str] = None) -> bytes
Run a command and pipe it to grep for some output. The output is returned.

For example this command:
ps -aux | grep pineap
Looks like this:
grep_output('ps -aux', 'pineap')

Parameters

  • command: The initial command to run.
  • grep_text: The text to grep for.
  • grep_options: Any options to be passed to grep.

Returns

  • bytes: The output as bytes.

def check_for_process(process_name) -> bool
Check if a process is running by its name.

Parameters

  • process_name: The name of the process to look for.

Returns

  • bool: True if the process is running, False if it is not.