Skip to content

Commit

Permalink
-- Format files with tab
Browse files Browse the repository at this point in the history
  • Loading branch information
vinayyadav3016 committed Mar 4, 2017
1 parent a2db46e commit 69c9868
Show file tree
Hide file tree
Showing 13 changed files with 251 additions and 259 deletions.
4 changes: 2 additions & 2 deletions ScreenBrightnessDown.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
#===============================================================================

set -o nounset # Treat unset variables as an error
#!/bin/bash

brightness=$(cat "/sys/class/backlight/intel_backlight/brightness")
a=$((brightness-5))

if [ "$brightness" -gt 1 ]
then
echo $a >> /sys/class/backlight/intel_backlight/brightness
echo $a >> /sys/class/backlight/intel_backlight/brightness
fi

4 changes: 2 additions & 2 deletions ScreenBrightnessUp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
#===============================================================================

set -o nounset # Treat unset variables as an error
#!/bin/bash

brightness=$(cat "/sys/class/backlight/intel_backlight/brightness")
a=$((brightness+5))

if [ "$brightness" -lt 100 ]
then
echo $a >> /sys/class/backlight/intel_backlight/brightness
echo $a >> /sys/class/backlight/intel_backlight/brightness
fi

2 changes: 1 addition & 1 deletion compile_example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -o nounset # Treat unset variables as an error

Expand Down
112 changes: 56 additions & 56 deletions deployToArduino.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
#!/bin/bash -
#===============================================================================
#
# FILE: deployToArduino.sh
# FILE: deployToArduino.sh
#
# USAGE: ./deployToArduino.sh
# USAGE: ./deployToArduino.sh
#
# DESCRIPTION:
# DESCRIPTION:
#
# OPTIONS:
# OPTIONS:
# REQUIREMENTS: Arduino
# BUGS: ---
# NOTES: ---
# AUTHOR: Vinay Yadav,
# BUGS: ---
# NOTES: ---
# AUTHOR: Vinay Yadav,
# ORGANIZATION: Freelancer
# CREATED: Tuesday 23 December 2014 09:51
# REVISION: ---
# CREATED: Tuesday 23 December 2014 09:51
# REVISION: ---
#===============================================================================

set -o nounset # Treat unset variables as an error
set -o nounset # Treat unset variables as an error

error() {
echo "Usage : -f flash -p port -d device -b buadrate -u uploader -h for help"
echo "Flash : main.hex"
echo "Device : atmega328p"
echo "Port : /dev/ttyACM0"
echo "Port : /dev/ttyACM0"
echo "Baudrate : 115200"
echo "Uploader : arduino(for 328p), wiring(mega2560)"
exit $@
Expand All @@ -38,35 +38,35 @@ TEMP=`getopt -o f:d:b:p:u:h --long flash:,device:,baudrate:,port:,uploader: --
eval set -- "$TEMP"
while true
do
case $1 in
-f|--flash)
#echo "Flash : $2"
HEX_FILE=$2
shift 2;;
-d|--device)
#echo "Device : $2"
DEVICE=$2
shift 2;;
-p|--port)
#echo "Port : $2"
PORT=$2
shift 2;;
-b|--baudrate)
#echo "Baudrate : $2"
BAUDRATE=$2
shift 2;;
-u|--uploader)
#echo "Uploader : $2"
UPLOADER=$2
shift 2;;
--)
shift;
break;;
-h)
error 0;;
*)
error 0
esac
case $1 in
-f|--flash)
#echo "Flash : $2"
HEX_FILE=$2
shift 2;;
-d|--device)
#echo "Device : $2"
DEVICE=$2
shift 2;;
-p|--port)
#echo "Port : $2"
PORT=$2
shift 2;;
-b|--baudrate)
#echo "Baudrate : $2"
BAUDRATE=$2
shift 2;;
-u|--uploader)
#echo "Uploader : $2"
UPLOADER=$2
shift 2;;
--)
shift;
break;;
-h)
error 0;;
*)
error 0
esac
done

if [[ -z "$HEX_FILE" ]]
Expand Down Expand Up @@ -98,21 +98,21 @@ fi

if [[ -c "$PORT" ]]
then
#echo "PORT exist"
if [[ -f "$HEX_FILE" ]]
then
echo "Flash : $HEX_FILE"
echo "Device : $DEVICE"
echo "Port : $PORT"
echo "Baudrate : $BAUDRATE"
echo "Uploader : $UPLOADER"
#avrdude -C/usr/share/arduino/hardware/tools/avrdude.conf\
#avrdude -C/usr/share/arduino/hardware/tools/avr/etc/avrdude.conf\
avrdude -C/etc/avrdude.conf -v \
-p$DEVICE -c$UPLOADER -P$PORT -b$BAUDRATE -D -Uflash:w:$HEX_FILE:i
else
echo "File $HEX_FILE do not exist"
fi
#echo "PORT exist"
if [[ -f "$HEX_FILE" ]]
then
echo "Flash : $HEX_FILE"
echo "Device : $DEVICE"
echo "Port : $PORT"
echo "Baudrate : $BAUDRATE"
echo "Uploader : $UPLOADER"
#avrdude -C/usr/share/arduino/hardware/tools/avrdude.conf\
#avrdude -C/usr/share/arduino/hardware/tools/avr/etc/avrdude.conf\
avrdude -C/etc/avrdude.conf -v \
-p$DEVICE -c$UPLOADER -P$PORT -b$BAUDRATE -D -Uflash:w:$HEX_FILE:i
else
echo "File $HEX_FILE do not exist"
fi
else
echo "Port $PORT do not Exist"
echo "Port $PORT do not Exist"
fi
174 changes: 87 additions & 87 deletions deployToBeagleBone.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
#!/bin/bash -
#===============================================================================
#
# FILE: deplyToBeagleBone.sh
# FILE: deplyToBeagleBone.sh
#
# USAGE: ./deplyToBeagleBone.sh
# USAGE: ./deplyToBeagleBone.sh
#
# DESCRIPTION:
# DESCRIPTION:
#
# OPTIONS:
# OPTIONS:
# REQUIREMENTS: indido-arm
# BUGS: ---
# NOTES: ---
# AUTHOR: Vinay Yadav,
# BUGS: ---
# NOTES: ---
# AUTHOR: Vinay Yadav,
# ORGANIZATION: Freelancer
# CREATED: Tuesday 23 December 2014 09:51
# REVISION: ---
# CREATED: Tuesday 23 December 2014 09:51
# REVISION: ---
#===============================================================================

set -o nounset # Treat unset variables as an error
set -o nounset # Treat unset variables as an error
## user at beaglebone
UNAME=robot
## ip of beaglebone
Expand All @@ -35,85 +35,85 @@ eval set -- "$TEMP"
B=0;L=0;M=0;R=0;E=0
while true
do
case $1 in
-b|--binaries)
#echo "Deploying Binaries."
B=1
shift;;
-l|--libs)
#echo "Libraries deployed"
L=1
shift;;
-m|--manifest)
#echo "manifest deployed"
M=1
shift;;
-r|--raslaunch)
#echo "roslaunch file deployed"
R=1
shift;;
-e|--extra)
#echo "Extra are deployed : ${2}"
E=1
shift 2;;
-p|--project)
#echo "Deploying Project : ${2}"
PROJECT=$2
source /opt/ros/indigo-arm/env-arm-ros.sh
HOST_DIR=`rospack find $2`
shift 2;;
--)
shift; break;;
*)
echo "-b to send binary"
echo "-m to send manifest file"
echo "-l to send libs"
echo "-p project name to be deployed : required"
echo "-e deploy some extra file"
exit 0
esac
case $1 in
-b|--binaries)
#echo "Deploying Binaries."
B=1
shift;;
-l|--libs)
#echo "Libraries deployed"
L=1
shift;;
-m|--manifest)
#echo "manifest deployed"
M=1
shift;;
-r|--raslaunch)
#echo "roslaunch file deployed"
R=1
shift;;
-e|--extra)
#echo "Extra are deployed : ${2}"
E=1
shift 2;;
-p|--project)
#echo "Deploying Project : ${2}"
PROJECT=$2
source /opt/ros/indigo-arm/env-arm-ros.sh
HOST_DIR=`rospack find $2`
shift 2;;
--)
shift; break;;
*)
echo "-b to send binary"
echo "-m to send manifest file"
echo "-l to send libs"
echo "-p project name to be deployed : required"
echo "-e deploy some extra file"
exit 0
esac
done
if [[ -d "$HOST_DIR" ]]
then
echo "Deploying project : $PROJECT"
REMOTE_DIR=${REMOTE_DIR}/$(echo ${HOST_DIR} | cut -d/ -f6- )
if [[ "$M" = 1 ]];
then
echo "Deploying manifest file."
if [[ -f "$HOST_DIR/manifest.xml" ]]
then
$BIN $HOST_DIR/manifest.xml $UNAME@$REMOTE:$REMOTE_DIR/
fi
fi
if [[ "$B" = 1 ]];
then
echo "Deploying Binaries."
if [[ $(ls "$HOST_DIR/bin/") ]]
then
$BIN $HOST_DIR/bin/* $UNAME@$REMOTE:$REMOTE_DIR/bin/
fi
fi
if [[ "$L" = 1 ]];
then
echo "Libraries deployed"
if [[ $(ls "$HOST_DIR/lib/") ]]
then
$BIN $HOST_DIR/lib/* $UNAME@$REMOTE:$LIB_DIR/
fi
fi
if [[ "$R" = 1 ]];
then
echo "roslaunch file deployed"
if [[ -f "$HOST_DIR/roslaunch/*" ]]
then
$BIN $HOST_DIR/roslaunch/* $UNAME@$REMOTE:$REMOTE_DIR/roslaunch/
fi
fi
if [[ "$E" = 1 ]];
then
echo "some extra file"
fi
echo "Deploying project : $PROJECT"
REMOTE_DIR=${REMOTE_DIR}/$(echo ${HOST_DIR} | cut -d/ -f6- )
if [[ "$M" = 1 ]];
then
echo "Deploying manifest file."
if [[ -f "$HOST_DIR/manifest.xml" ]]
then
$BIN $HOST_DIR/manifest.xml $UNAME@$REMOTE:$REMOTE_DIR/
fi
fi
if [[ "$B" = 1 ]];
then
echo "Deploying Binaries."
if [[ $(ls "$HOST_DIR/bin/") ]]
then
$BIN $HOST_DIR/bin/* $UNAME@$REMOTE:$REMOTE_DIR/bin/
fi
fi
if [[ "$L" = 1 ]];
then
echo "Libraries deployed"
if [[ $(ls "$HOST_DIR/lib/") ]]
then
$BIN $HOST_DIR/lib/* $UNAME@$REMOTE:$LIB_DIR/
fi
fi
if [[ "$R" = 1 ]];
then
echo "roslaunch file deployed"
if [[ -f "$HOST_DIR/roslaunch/*" ]]
then
$BIN $HOST_DIR/roslaunch/* $UNAME@$REMOTE:$REMOTE_DIR/roslaunch/
fi
fi
if [[ "$E" = 1 ]];
then
echo "some extra file"
fi
else
echo "Project name $REMOTE_DIR not found"
exit 0;
echo "Project name $REMOTE_DIR not found"
exit 0;
fi
2 changes: 1 addition & 1 deletion freeram.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash


PrintUsage(){
PrintUsage() {
echo -e "No input is given for cleanup"
echo -e "freeram.sh number"
echo -e "\t1: drop pagecache"
Expand Down
Loading

0 comments on commit 69c9868

Please sign in to comment.