From 1f45e0a5aaaf0aec106876fec1cfe4895460b86e Mon Sep 17 00:00:00 2001 From: lonkaars Date: Tue, 26 Apr 2022 13:52:01 +0200 Subject: project bootstrap script --- scripts/install-sdk.sh | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'scripts/install-sdk.sh') diff --git a/scripts/install-sdk.sh b/scripts/install-sdk.sh index 56243c8..4773186 100755 --- a/scripts/install-sdk.sh +++ b/scripts/install-sdk.sh @@ -1,32 +1,38 @@ #!/bin/sh +OS=`uname -o` +LINUX="GNU/Linux" +WINDOWS="Msys" + bye () { echo "run me as root!" exit 1 } -[ $(id -g) -ne 0 ] && bye +[ "$OS" != "$WINDOWS" ] && [ $(id -g) -ne 0 ] && bye mkdir temp cd temp wget https://www.pololu.com/file/0J1058/libpololu-avr-151002.zip -O libpololu-avr.zip -wget https://www.pololu.com/file/0J490/wixel-linux-110623-amd64.tar.gz -O wixel-linux.tar.gz - unzip libpololu-avr.zip -tar -xvzf wixel-linux.tar.gz - -rm libpololu-avr.zip wixel-linux.tar.gz +rm libpololu-avr.zip cd libpololu-avr make install cd .. -cd wixel_linux -mv wixelconfig /usr/bin/wixelconfig -mv wixelcmd /usr/bin/wixelcmd -mv 99-pololu.rules /etc/udev/rules.d/99-pololu.rules -cd .. +if [ "$OS" = "$LINUX" ]; then + wget https://www.pololu.com/file/0J490/wixel-linux-110623-amd64.tar.gz -O wixel-linux.tar.gz + tar -xvzf wixel-linux.tar.gz + rm wixel-linux.tar.gz + + cd wixel_linux + mv wixelconfig /usr/bin/wixelconfig + mv wixelcmd /usr/bin/wixelcmd + mv 99-pololu.rules /etc/udev/rules.d/99-pololu.rules + cd .. +fi cd .. rm -rf temp -- cgit v1.2.3