Skip to content
Bash Script Examples writing for Raspbian
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
LICENSE
README.md

README.md

RaspberryPi Bash Script Examples

Bash Script Examples writing for Raspbian OS

Raspberry Pi image Image: Raspberry Pi 2 Model B 1GB

Attached scripts

  • blink.sh - blinking LED (On/Off GPIO)
  • colormusic.sh - blink 7 LED one after the other
  • colormusic2.sh - LED gradual lighting up and then gradually turning off
  • ifonline.sh - Check external server status by URL (LED blink / led Off = server is off line; LED lighting = server is online)
  • semafor.sh - Switch On/Off LED like as semafor
  • switch.sh - Switch On/Off GPIO when you write GPIO ID

Requirements

Install

  1. Copy files from /example/ in to path home/user/ (in Raspbian OS)
  2. And open it in terminal as sudo user

Run in Raspbian OS bash terminal

  1. Open terminal (CTRL+T or CTRL+ALT+F1)
  2. Write command in terminal like this sudo ./blink.sh
  3. Add GPIO ID when your script asks a question

Raspberry Pi ssh terminal window

Image: SSH Putty

  1. When answer all start up questions, script will be run

Raspbian script

Image: Raspberry Pi started bash script

End script

  • Some scripts end automaticaly but you can cancel running script by CTRL+C.

Have fun

You can’t perform that action at this time.