#!/bin/sh # This script serves as a magic mirror, reflecting the running status of Bitcoin # Look for bitcoin process if ps -e | grep -q '[b]itcoind'; then if [ -t 1 ]; then # Check if output is a terminal echo "Bitcoin is running." fi exit 0 # Bitcoin is running (success) else if [ -t 1 ]; then # Check if output is a terminal echo "Bitcoin is not running." fi exit 1 # Bitcoin is not running (failure) fi