#!/bin/sh

launchctl unload /System/Library/LaunchDaemons/org.apache.httpd.plist
/usr/sbin/httpd -k stop
killall httpd
rm -f /private/etc/apache2/{sites,other,users}/lasso9.apache2.conf
rm -f /private/etc/apache2/{sites,other,users}/lasso9.manager.conf
rm -f /private/etc/apache2/{sites,other,users}/mod_lasso9*.conf
rm -f /Library/Server/Web/Config/apache2/sites/mod_lasso9.conf

launchctl unload /Library/LaunchDaemons/com.lassosoft.lassoinstancemanager.plist
rm -f /Library/LaunchDaemons/com.lassosoft.lassoinstancemanager.plist

rm -rf "/Library/Application Support/LassoSoft/Lasso Instance Manager"
rm -rf /Library/Frameworks/Lasso9.framework
rm -rf /var/lasso

rm -f /usr/bin/{lasso9,lassoc}
rm -f /usr/sbin/{lassoim,lassoserver}
rm -f /usr/local/bin/{lasso9,lassoc,lassoserver}
rm -f /usr/libexec/apache2/mod_lasso9*.so

rm -rf "/Library/Receipts/Lasso Instance Manager.pkg"
rm -rf "/Library/Receipts/Lasso Server with Instance Manager.pkg"
pkgutil --forget com.lassosoft.pkg.lassoinstancemanager || true

grep -v LASSO9_ /etc/profile > /private/tmp/profile.lasso
mv -f /private/tmp/profile.lasso /etc/profile

launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist
