github.com/dbernstein1/tyk@v2.9.0-beta9-dl-apic+incompatible/install/post_remove.sh (about)

     1  #!/bin/bash
     2  echo "Removing init scripts..."
     3  
     4  SYSTEMD="/lib/systemd/system"
     5  UPSTART="/etc/init"
     6  SYSV1="/etc/init.d"
     7  SYSV2="/etc/rc.d/init.d/"
     8  DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
     9  
    10  if [ -f "/lib/systemd/system/tyk-gateway.service" ]; then
    11  	echo "Found Systemd"
    12  	echo "Stopping the service"
    13  	systemctl stop tyk-gateway.service
    14  	systemctl stop tyk-gateway-python.service
    15  	systemctl stop tyk-gateway-lua.service
    16  	echo "Removing the service"
    17  	rm /lib/systemd/system/tyk-gateway.service
    18  	rm /lib/systemd/system/tyk-gateway-python.service
    19  	rm /lib/systemd/system/tyk-gateway-lua.service
    20  	systemctl --system daemon-reload
    21  fi
    22  
    23  if [ -f "/etc/init/tyk-gateway.conf" ]; then
    24  	echo "Found upstart"
    25  	echo "Stopping the service"
    26  	stop tyk-gateway
    27  	stop tyk-gateway-python
    28  	stop tyk-gateway-lua
    29  	echo "Removing the service"
    30  	rm /etc/init/tyk-gateway.conf
    31  	rm /etc/init/tyk-gateway-python.conf
    32  	rm /etc/init/tyk-gateway-lua.conf
    33  fi
    34  
    35  if [ -f "/etc/init.d/tyk-gateway" ]; then
    36  	echo "Found Sysv1"
    37  	/etc/init.d/tyk-gateway stop
    38  	/etc/init.d/tyk-gateway-python stop
    39  	/etc/init.d/tyk-gateway-lua stop
    40  	rm /etc/init.d/tyk-gateway
    41  	rm /etc/init.d/tyk-gateway-python
    42  	rm /etc/init.d/tyk-gateway-lua
    43  fi
    44  
    45  if [ -f "/etc/rc.d/init.d/tyk-gateway" ]; then
    46  	echo "Found Sysv2"
    47  	echo "Stopping the service"
    48  	/etc/rc.d/init.d/tyk-gateway stop
    49  	/etc/rc.d/init.d/tyk-gateway-python stop
    50  	/etc/rc.d/init.d/tyk-gateway-lua stop
    51  	echo "Removing the service"
    52  	rm /etc/rc.d/init.d/tyk-gateway
    53  	rm /etc/rc.d/init.d/tyk-gateway-python
    54  	rm /etc/rc.d/init.d/tyk-gateway-lua
    55  fi