Merge pull request #75 from tijmenvandenbrink/master
[EVA-2020-02-2.git] / uninstall.sh
CommitLineData
651e1c20
PH
1#!/bin/bash
2
ab1eb580
PH
3LIBRARY_VERSION=`cat library/setup.cfg | grep version | awk -F" = " '{print $2}'`
4LIBRARY_NAME=`cat library/setup.cfg | grep name | awk -F" = " '{print $2}'`
651e1c20 5
1b2cabb8 6printf "$LIBRARY_NAME $LIBRARY_VERSION Python Library: Uninstaller\n\n"
651e1c20
PH
7
8if [ $(id -u) -ne 0 ]; then
9 printf "Script must be run as root. Try 'sudo ./uninstall.sh'\n"
10 exit 1
11fi
12
13cd library
14
15printf "Unnstalling for Python 2..\n"
1b2cabb8 16pip uninstall $LIBRARY_NAME
651e1c20
PH
17
18if [ -f "/usr/bin/pip3" ]; then
19 printf "Uninstalling for Python 3..\n"
1b2cabb8 20 pip3 uninstall $LIBRARY_NAME
651e1c20
PH
21fi
22
23cd ..
24
d7ce2531
PH
25printf "Disabling serial..\n"
26# Enable serial terminal over /dev/ttyAMA0
27raspi-config nonint do_serial 0
28# Disable serial port
29raspi-config nonint set_config_var enable_uart 0 /boot/config.txt
30# Switch serial port back to miniUART
ab1eb580 31sed -i 's/^dtoverlay=pi3-miniuart-bt # for Enviro+/#dtoverlay=pi3-miniuart-bt # for Enviro+/' /boot/config.txt
d7ce2531 32
651e1c20 33printf "Done!\n"