From cf079a8c21299b87703a5573b817e9653bf1c2f8 Mon Sep 17 00:00:00 2001 From: Dejvino Date: Mon, 14 Dec 2020 14:22:01 +0100 Subject: [PATCH] Add toolkit scripts --- toolkit/emergency-light | 18 ++++++++++++++++++ toolkit/pa-power | 18 ++++++++++++++++++ toolkit/system-activity-light | 20 ++++++++++++++++++++ toolkit/system-usage | 4 ++++ 4 files changed, 60 insertions(+) create mode 100755 toolkit/emergency-light create mode 100755 toolkit/pa-power create mode 100755 toolkit/system-activity-light create mode 100755 toolkit/system-usage diff --git a/toolkit/emergency-light b/toolkit/emergency-light new file mode 100755 index 0000000..ce049ed --- /dev/null +++ b/toolkit/emergency-light @@ -0,0 +1,18 @@ +#!/bin/bash + +PIN_ELIGHT=7 + +# init +gpio mode $PIN_ELIGHT output + +# command +if [[ "$1" == "on" ]]; then + gpio write $PIN_ELIGHT 1 +elif [[ "$1" == "off" ]]; then + gpio write $PIN_ELIGHT 0 +elif [[ "$1" == "read" ]]; then + gpio read $PIN_ELIGHT +else + gpio toggle $PIN_ELIGHT +fi + diff --git a/toolkit/pa-power b/toolkit/pa-power new file mode 100755 index 0000000..7655ebf --- /dev/null +++ b/toolkit/pa-power @@ -0,0 +1,18 @@ +#!/bin/bash + +PIN_PAPOWER=5 + +# init +gpio mode $PIN_PAPOWER output + +# command +if [[ "$1" == "on" ]]; then + gpio write $PIN_PAPOWER 1 +elif [[ "$1" == "off" ]]; then + gpio write $PIN_PAPOWER 0 +elif [[ "$1" == "read" ]]; then + gpio read $PIN_PAPOWER +else + gpio toggle $PIN_PAPOWER +fi + diff --git a/toolkit/system-activity-light b/toolkit/system-activity-light new file mode 100755 index 0000000..a6f9277 --- /dev/null +++ b/toolkit/system-activity-light @@ -0,0 +1,20 @@ +#!/bin/bash + +PIN_SALIGHT=11 + +# init +gpio mode $PIN_SALIGHT output + +# command +if [[ "$1" == "on" ]]; then + gpio write $PIN_SALIGHT 1 +elif [[ "$1" == "off" ]]; then + gpio write $PIN_SALIGHT 0 +elif [[ "$1" == "read" ]]; then + gpio read $PIN_SALIGHT +elif [[ "$1" == "blink" ]]; then + gpio blink $PIN_SALIGHT $2 $3 +else + gpio toggle $PIN_SALIGHT +fi + diff --git a/toolkit/system-usage b/toolkit/system-usage new file mode 100755 index 0000000..95bc9fa --- /dev/null +++ b/toolkit/system-usage @@ -0,0 +1,4 @@ +#!/bin/bash + +uptime | head -n 1 | cut -f3 -d, | cut -f2 -d: +