2020-07-03 03:01:37 +08:00
|
|
|
#!/bin/bash
|
2020-07-24 13:42:51 +08:00
|
|
|
set -e
|
|
|
|
|
2020-07-03 03:01:37 +08:00
|
|
|
if [ "$EUID" -ne 0 ]; then
|
2020-07-24 13:42:51 +08:00
|
|
|
echo "Please run this script as root ( or with sudo )" ;
|
|
|
|
exit 1;
|
2020-07-03 03:01:37 +08:00
|
|
|
fi;
|
|
|
|
|
2020-07-03 03:20:36 +08:00
|
|
|
|
2021-03-23 21:59:27 +08:00
|
|
|
IMAGE_CHECK=`docker image inspect bbb-soffice 2>&1 > /dev/null && echo 1 || echo 0`
|
|
|
|
if [ "$IMAGE_CHECK" = "1" ]; then
|
2020-07-03 03:01:37 +08:00
|
|
|
echo "Removing image"
|
2021-03-23 21:59:27 +08:00
|
|
|
docker image rm bbb-soffice
|
2020-07-03 03:01:37 +08:00
|
|
|
fi
|
|
|
|
|
2021-03-23 21:59:27 +08:00
|
|
|
FOLDER_CHECK=`[ -d /usr/share/bbb-libreoffice-conversion/ ] && echo 1 || echo 0`
|
2020-07-03 03:01:37 +08:00
|
|
|
if [ "$FOLDER_CHECK" = "1" ]; then
|
|
|
|
echo "Removing install folder"
|
2021-03-23 21:59:27 +08:00
|
|
|
rm -rf /usr/share/bbb-libreoffice-conversion/
|
|
|
|
fi;
|
2020-07-03 03:01:37 +08:00
|
|
|
|
2021-03-23 21:59:27 +08:00
|
|
|
FILE_SUDOERS_CHECK=`[ -f /etc/sudoers.d/zzz-bbb-docker-libreoffice ] && echo 1 || echo 0`
|
|
|
|
if [ "$FILE_SUDOERS_CHECK" = "1" ]; then
|
|
|
|
echo "Removing Sudoers file"
|
|
|
|
rm /etc/sudoers.d/zzz-bbb-docker-libreoffice
|
2020-07-03 03:01:37 +08:00
|
|
|
fi;
|