Created
October 19, 2014 20:29
-
-
Save matt448/df7b09cbe606aab6fd73 to your computer and use it in GitHub Desktop.
Revisions
-
matt448 created this gist
Oct 19, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ #!/bin/bash re='^[0-9]+$' if ! [[ $1 =~ $re ]] ; then echo -e "ERROR: Can bus bitrate not a number or a value wasn't entered.\n\nPlease enter a speed in Kbit/s\n\n Example: canbus_start.sh 100\n Speeds: 100,125,250,500\n" >&2; exit 1 fi echo Bitrate: ${1}Kbit/s sudo modprobe can sudo modprobe can-dev sudo modprobe can-raw sudo ip link set can0 up type can bitrate ${1}000 sudo ifconfig can0 up