#!/bin/bash

# Déinstallation de scodoc
# Ne touche pas aux données (/opt/scodoc-data)
# N'enlève complètement /opt/scodoc qui si --purge

systemctl stop scodoc9
systemctl disable scodoc9

if [ "$#" == 1 ] && [ "$1" == "purge" ]
then
    /bin/rm -rf /opt/scodoc
    /bin/rm -f scodoc9.service
    /bin/rm -f /etc/systemd/system/scodoc-updater.service 
    /bin/rm -f /etc/systemd/system/scodoc-updater.timer 
    /bin/rm -f /etc/nginx/sites-enabled/scodoc9.nginx
fi

systemctl reload nginx
