Commit 7425246a authored by Philippe Gauron's avatar Philippe Gauron
Browse files

remise à plat du script de désinstallation

parent af90ddbb
......@@ -8,55 +8,96 @@ set -e
## préparation test desinstallation
apt install --assume-yes kdiff3 debconf-utils
apt install --assume-yes debconf-utils
### Preparation of uninstallation tools ###
DEBIAN_FRONTEND=noninteractive
REPO_DIR=$(pwd)/$(dirname $0)
REPO_DIR=$(pwd)/$(dirname "$0")
echo "REPO_DIR=${REPO_DIR}"
## Removing of ARCHIVING installation packages
# supprimer "${SUDO_USER}" de /etc/cron.allow'
if [ -e /etc/cron.allow ]
then
sed -i -e "/${SUDO_USER}/d" /etc/cron.allow
fi
# supprimer "0 2 * * * ${REPO_DIR}/archive1/delete_unmodified_since.sh > ${ARCHIVING_DIR}/hdbtdb_delete_data_and_diary_files.log" du fichier "/var/spool/cron/crontabs/${USERNAME}"
if [ -e "/var/spool/cron/crontabs/${SUDO_USER}" ]
then
sed -i -e "/hdbtdb/d" "/var/spool/cron/crontabs/${SUDO_USER}"
fi
service cron restart
# remove symbolic link from /etc/bashrc to /etc/bash.bashrc if exists
if [ -L /etc/bashrc ]
then
rm -f /etc/bash.bashrc
fi
# remove tangorc configuration file
rm -f /etc/tangorc
# remove ArchivingRoot files
rm -rf /opt/ArchivingRoot
apt purge --assume-yes unzip
service mysql restart
## Removing of CLIENT installation packages
# libraries for LabView GUIs
apt-get remove --assume-yes libx32gcc-6-dev libgl1-mesa-dev:i386 libxinerama1:i386 ntpdate ntp rdesktop
# Basler Pylon
rm -rf /opt/pylon*
## Removing of TANGO_DB installation packages
# configure dbconfig-common to delete Database and revoke rights
echo 'tango-db tango-db/dbconfig-remove boolean true' | debconf-set-selections
echo 'tango-db tango-db/purge boolean true' | debconf-set-selections
apt purge --assume-yes tango-db
## Removing of TANGO installation packages
# removing manual installation of libtango-java
apt purge --assume-yes libtango-java
rm -rf /usr/lib/yat /usr/lib/yat4tango
# deleting manual installation yat & yat4tango
rm -rf /usr/lib/{yat,yat4tango}
rm /usr/lib/libyat.so /usr/lib/libyat.so.* /usr/lib/libyat4tango.so /usr/lib/libyat4tango.so.*
apt purge --assume-yes subversion pkg-config cmake
# Remove Hg-git
sed -i -e "/# Hg-Git plugin for Mercurial/d" /etc/mercurial/hgrc
sed -i -e "/hgext.bookmarks =/d" /etc/mercurial/hgrc
sed -i -e "/hggit =/d" /etc/mercurial/hgrc
pip uninstall -y hg-git dulwich
## GUI packages
pip uninstall -y fandango taurus PyYAML QtPy
apt purge --assume-yes python-qt4 qt4-designer pyqt4-dev-tools python-pytango python-qtpy python-qwt5-qt4 python-guiqwt python-pymca5 python-ply spyder python-lxml
## Development packages
apt purge --assume-yes gcc g++ make xemacs21 man python-pip
apt purge --assume-yes gcc g++ make xemacs21 man
## TANGO packages
#configurer dbconfig-common pour supprimer la BD et révoquer les droits
apt purge --assume-yes tango-common tango-starter tango-test libtango-doc libtango-dev liblog4j1.2-java
# supprimer "source /etc/tangorc" de /etc/bash.bashrc'
sed -i -e "/tangorc/d" /etc/bash.bashrc
# supprimer export TANGO_HOST" de /etc/bash.bashrc'
sed -i -e "/TANGO_HOST/d" /etc/bash.bashrc
### Installation of Oracle Java
rm -rf /opt/java
## Hggit
sudo pip uninstall -y dulwich
###### TODO : uninstall hg-git
## GUI packages
sudo pip uninstall -y fandango taurus PyYAML QtPy
sudo apt purge --assume-yes python-qt4 qt4-designer pyqt4-dev-tools
sudo apt purge --assume-yes python-pytango python-qtpy python-qwt5-qt4 python-guiqwt python-pymca5 python-ply spyder python-lxml
## Development packages
sudo apt purge --assume-yes python-dev gcc g++ make xemacs21 man
### tango packages
#### TODO
#### dbconfig-common doit supprimer la base de données et révoquer les déconfigurer tango-db
echo 'dbconfig-common dbconfig-common/dbconfig-remove boolean true' | sudo debconf-set-selections
#### dbconfig-common doit supprimer la base de données et révoquer les droits
#### défaire la configuration de la base de données de tango-db avec dbconfig-common
#### supprimer la base de données pour tango-db
sudo apt purge --assume-yes tango-common tango-starter tango-test python-pytango libtango-doc libtango-dev liblog4j1.2-java
### Définit les binaires java vers openjdk
## Définit les binaires java vers openjdk
update-alternatives --remove java /opt/java/jdk1.8.0_212/bin/java
#update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1
update-alternatives --remove javac /opt/java/jdk1.8.0_212/bin/javac
......@@ -67,41 +108,24 @@ rm -rf /opt/java/
## Removing of CLIENT installation packages
apt-get remove --assume-yes libx32gcc-6-dev libgl1-mesa-dev:i386 libxinerama1:i386 ntpdate ntp rdesktop
rm -rf /opt/pylon*
## Removing of ARCHIVING installation packages
sudo service mysql stop
# supprimer "${SUDO_USER}" de /etc/cron.allow'
# supprimer "0 2 * * * ${REPO_DIR}/archive1/delete_unmodified_since.sh > ${ARCHIVING_DIR}/hdbtdb_delete_data_and_diary_files.log" du fichier "/var/spool/cron/crontabs/${USERNAME}"
apt purge --assume-yes unzip
rm -rf /opt/ArchivingRoot
rm -rf /etc/tangorc
## Removing DATABASE installation packages
# PHPMyadmin
# remove symbolic link from /var/www/phpmyadmin to /usr/share/phpmyadmin/ if exists
if [ -L /etc/bashrc ]
then
rm -f /etc/bash.bashrc
fi
rm -rf /var/archivage
## Removing of TANGO_DB installation packages
sudo apt purge --assume-yes tango-db
## Removing DATABASE installation packages
# PHPMyadmin
# remove phpmyadmin
echo 'phpmyadmin phpmyadmin/dbconfig-remove boolean true' | debconf-set-selections
echo 'phpmyadmin phpmyadmin/purge boolean true' | debconf-set-selections
apt purge --assume-yes phpmyadmin
echo PURGE | debconf-communicate phpmyadmin
# MariaDB
service mysql stop
echo PURGE | debconf-communicate mariadb-client
echo PURGE | debconf-communicate mariadb-server
apt purge --assume-yes mariadb-client mariadb-server
apt purge --assume-yes expect mariadb-client mariadb-server
rm -rf /etc/mysql/
rm -f /var/www/phpmyadmin
......@@ -110,14 +134,11 @@ rm -f /var/www/phpmyadmin
## Removing common tools for all installations
sudo apt purge --assume-yes host mercurial python-pip
apt purge --assume-yes host mercurial python-pip
## Removing installation tools ###
sudo apt purge --assume-yes debconf dirmngr
apt purge --assume-yes debconf-utils dirmngr
#sudo apt-get update
#sudo apt-get clean
sudo apt-get autoremove --assume-yes
#sudo apt-get upgrade --assume-yes
#sudo apt-get update
apt-get clean
apt-get autoremove --assume-yes
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment