3 # Movidius Neural Compute Toolkit uninstall script.
5 # Function main at the bottom calls all of the other functions required to uninstall.
7 # Please provide feedback in our support forum if you encountered difficulties.
8 ################################################################################
9 # read in functions shared by installer and uninstaller
10 source $(dirname "$0")/install-utilities.sh
12 # remove_NCSDK_from_PYTHONPATH - removes PYTHONPATH from $HOME/.bashrc
13 function remove_NCSDK_from_PYTHONPATH()
15 [ "${VERBOSE}" = "yes" ] && printf "Remove NCSDK references from PYTHONPATH..."
16 #sed -i "\#export PYTHONPATH=\"\${PYTHONPATH}:"${PREV_NCSDK_PATH}"/mvnc/python\"#d" $HOME/.bashrc
17 sed -i "\#export PYTHONPATH=\"\${PYTHONPATH}:"${PREV_NCSDK_PATH}"/caffe/python\"#d" $HOME/.bashrc
18 # Remove some of the older versions of this as well
19 sed -i "\#export PYTHONPATH=\$env:\""${PREV_NCSDK_PATH}"/mvnc/python\":\$PYTHONPATH#d" $HOME/.bashrc
20 sed -i "\#export PYTHONPATH=\$env:\""${PREV_NCSDK_PATH}"/caffe/python\":\$PYTHONPATH#d" $HOME/.bashrc
21 [ "${VERBOSE}" = "yes" ] && printf "done\n"
25 # remove_caffe - remove version of caffe built during the install
26 function remove_caffe()
28 [ "${VERBOSE}" = "yes" ] && printf "Removing ${INSTALL_DIR}/${CAFFE_FLAVOR}-caffe..."
29 # remove caffe directory
30 check_and_remove_files ${INSTALL_DIR}/${CAFFE_FLAVOR}-caffe
31 # remove caffe soft link
32 check_and_remove_file ${INSTALL_DIR}/caffe
33 [ "${VERBOSE}" = "yes" ] && printf "done\n"
37 # remove_install_dir - remove ${INSTALL_DIR} if ${NCSDK1_ARCHIVE_DIR} doesn't exist, the dir NCSDK 1.x files were moved to
38 function remove_install_dir()
40 if [ -d ${NCSDK1_ARCHIVE_DIR} ] ; then
42 echo -e "${YELLOW}Warning: Detected an NCSDK 1.x backup directory at ${NCSDK1_ARCHIVE_DIR}"
43 read -p "Delete this directory (y/n) ? " CONTINUE
45 if [[ "$CONTINUE" = "y" || "$CONTINUE" = "Y" ]]; then
46 echo "Based on user input, will remove ${NCSDK1_ARCHIVE_DIR}"
47 ${SUDO_PREFIX} rm -rf ${NCSDK1_ARCHIVE_DIR}
49 # if user wants to keep ${NCSDK1_ARCHIVE_DIR}, don't rm ${INSTALL_DIR}
50 echo "Not removing ${INSTALL_DIR} because ${NCSDK1_ARCHIVE_DIR} exists, the directory where NCSDK 1.x files were moved to"
54 [ "${VERBOSE}" = "yes" ] && printf "Removing ${INSTALL_DIR}/..."
55 check_and_remove_files ${INSTALL_DIR}
56 [ "${VERBOSE}" = "yes" ] && printf "done\n"
60 # main - this is the main function that runs the uninstall
63 echo "Movidius Neural Compute Toolkit uninstall"
65 ### get constants, function is in install-utilities.sh
68 ### ask for sudo priviledges, function is in install-utilities.sh
71 ### function is in install-utilities.sh
74 # override value in ncsdk.config for uninstall
77 ### function is in install-utilities.sh
80 ### remove prev installation. Function is in install-utilities.sh
81 remove_previous_install
83 ### edit $HOME/.bashrc
84 remove_NCSDK_from_PYTHONPATH
86 ### remove version of caffe that installer installed
90 echo "Movidius Neural Compute Toolkit uninstall finished"