#!/bin/sh # I2P Installer - Installs and pre-configures I2P. # # uninstall_i2p_service_unix # 2004 The I2P Project # http://www.i2p.net # This code is public domain. # # author: hypercubus # # Uninstalls the Java Service Wrapper-based I2P service on various *nix systems. # This script must be run as root. # # Java Service Wrapper can be found at: # http://wrapper.tanukisoftware.org/doc/english/introduction.html if [ $UID -ne 0 ]; then echo "Sorry, you need root privileges to uninstall services." exit 1 fi ERROR_MSG="Cannot determine operating system type. Please uninstall the service manually." HOST_OS=`./osid` if [[ ! $HOST_OS || $HOST_OS = "unknown" ]]; then echo "$ERROR_MSG" exit 1 fi # The following are several different service uninstallation methods covering # some of the major *nix operating systems. Most *nix OSes should be able to use # one of these styles. TODO: AIX, HP-UX, HP-UX/64, IRIX, OSF/1. uninstall_bsd() { rm /usr/local/etc/rc.d/i2psvc.sh } uninstall_debian() { rm /etc/init.d/i2psvc update-rc.d -f i2psvc remove } uninstall_gentoo() { rm /etc/init.d/i2psvc rc-update del i2psvc default } uninstall_redhat() { rm /etc/rc.d/init.d/i2psvc chkconfig --level 345 i2psvc off } uninstall_sysv() { rm /etc/init.d/i2psvc rm /etc/rc0.d/K20i2psvc rm /etc/rc1.d/K20i2psvc rm /etc/rc2.d/S20i2psvc rm /etc/rc3.d/S20i2psvc } case $HOST_OS in debian ) uninstall_debian ;; fedora | mandrake | redhat | suse ) uninstall_redhat ;; freebsd | osx ) uninstall_bsd ;; gentoo ) uninstall_gentoo ;; solaris ) uninstall_sysv ;; * ) echo "$ERROR_MSG" exit 1 ;; esac exit 0