6 rm -f /tmp/ncsdk_redirector.txt
8 if [ -f ncsdk_redirector.txt ]
10 cp ncsdk_redirector.txt /tmp
14 #wget --no-cache http://ncs-forum-uploads.s3.amazonaws.com/ncsdk/ncsdk_01_12/ncsdk_redirector.txt
15 wget --no-cache -O ncsdk_redirector.txt "https://ncs-forum-uploads.s3-us-west-1.amazonaws.com/ncsdk/ncsdk_01_012_B/ncsdk_redirector.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJPV7SAH5YZ2U3ARA/20180314/us-west-1/s3/aws4_request&X-Amz-Date=20180314T233615Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=8886c9b49d0017ef736c9d226ff6763552f46fa501163fcbe769035c63b84456"
18 download_filename=NCSDK-1.12.tar.gz
20 # redirector is the url from redirector text file
21 redirector=$(<ncsdk_redirector.txt)
23 # ncsdk_link is the url with '\r' deleted if it exists
24 # would probably be from editing in windows/dos
25 ncsdk_link=$(echo "$redirector" | tr -d '\r')
27 # download the payload from the redirector link
28 # and save it the download_filename no matter what the original filename was
29 wget --no-cache -O ${download_filename} $ncsdk_link
31 # Get the filenames, ncsdk_archive is just the download filename
32 # and ncsdk_pkg is the filename without the .tar.gz
33 #ncsdk_archive=$(echo "$ncsdk_link" | grep -o '[^/]*$')
34 ncsdk_archive=${download_filename}
35 ncsdk_pkg=${ncsdk_archive%%.tar.gz}
37 # now install-ncsdk.sh is doing the uninstallation if necessary.
38 # Remove older installation dirs
39 #if [ -f /opt/movidius/uninstall-ncsdk.sh ]
41 # echo "Removing previous install..."
42 # /opt/movidius/uninstall-ncsdk.sh
45 # Create Required installation dirs
46 sudo mkdir -p /opt/movidius
47 sudo cp $ncsdk_archive /opt/movidius/ncsdk.tar.gz
50 # untar the new install and run the install script
51 sudo tar zxvf ./ncsdk.tar.gz
53 sudo mv $ncsdk_pkg* NCSDK
54 cd /opt/movidius/NCSDK
58 # leave the uninstall script on the target
59 #sudo cp ./uninstall-ncsdk.sh ../ncsdk/
65 sudo rm -f /tmp/${ncsdk_archive}