Projects // Raspi Commander

Overview

Raspi Commander is web based tool to remotely manage your Raspberry Pi (or other server).

Features Include:

  • Services
    • Monitor Services
    • Start/Stop/Restart Services
  • Run Scripts
    • Bash scripts
    • JSON scripts
  • Terminal Output
    • Shows the last run scripts and commands
  • External IP Address

Downloading Raspi Commander

$ git clone git@github.com:destinmoulton/raspi-commander.git

Configuring Raspi Commander

Rename or copy config.py.template to config.py.

# The IP address of the Raspberry Pi (or server)
IP = "127.0.0.1"
PORT = 9090

# The path where bash scripts and json commands live
SCRIPTS_PATH = "/path/to/scripts"

# The services you want to monitor
SERVICES_TO_MONITOR = [
    'samba',
    'ssh'
]

# Time Display Format
# Reference: http://strftime.org/
TIME_FORMAT = "%-I:%M:%S %p -- %b %-d, %Y"

# Javascript files to include
# These should be held in the "/res" folder
JS_FILES = [
    "raspicommander.js"
]

Starting the Server

$ python3 main.py

Scripts

Place your scripts in the folder configured in SCRIPTS_PATH in config.py.

You can run two different types of scripts.

  • Bash Scripts
  • JSON files that contain a python list of commands to run

The format of a JSON command file is:

{
    "name": "A test JSON script to run 'ls'.",
    "cmds": [["ls", "-alt"]]
}

The cmds must be a nested list.