| # Uninstalls device manager from the local machine. |
| # ./dmuninstall <install parent dir> |
| echo "./dmuninstall [--single_user] <install parent dir>" |
| if [[ "$1" == "--single_user" ]]; then |
| local -r SINGLE_USER=true |
| local -r SINGLE_USER=false |
| local -r INSTALL_PARENT_DIR="$1" |
| if [[ -z "${INSTALL_PARENT_DIR}" ]]; then |
| echo 'No local install directory specified!' |
| local -r INSTALL_DIR="${INSTALL_PARENT_DIR}/device_manager" |
| if [[ ! -d "${INSTALL_DIR}" ]]; then |
| echo "${INSTALL_DIR} does not exist or is not a directory!" |
| # Tell the device manager to uninstall itself. |
| local -r DM_ROOT="${INSTALL_DIR}/dmroot" |
| echo "Uninstalling device manager from ${DM_ROOT} ..." |
| local -r BIN_INSTALL="${INSTALL_DIR}/bin" |
| VEYRON_DM_CURRENT="${INSTALL_DIR}/deviced.curr" VEYRON_DM_ROOT="${DM_ROOT}" VEYRON_DM_HELPER="unused" "${BIN_INSTALL}/deviced" --uninstall |
| echo "Device manager uninstalled." |
| if [[ ${SINGLE_USER} == false ]]; then |
| sudo rm -rf "${INSTALL_DIR}" |
| echo "Removed ${INSTALL_DIR}" |