Create a gist now

Instantly share code, notes, and snippets.

Update post-uninstall script for the crossplatformui Ubuntu package to make sure it is uninstalled properly without errors. Details are here : http://techbrahmana.blogspot.in/2013/03/package-installation-error-on-ubuntu.html
#!/bin/sh
set -e
SETTING_DATA_PATH=".ztemtapp/ZTEEVDO"
#e.g. /var/lib/dpkg/info
# when execs "sudo dpkg -P xxxx", 1st execute this script with "remove" arg, then execute this script with "purge" arg
if [ "$1" = "remove" ] ; then
sudo sed '/ztemt/d' /etc/init.d/rc.local > tmpfile; sudo mv -f tmpfile /etc/init.d/rc.local; sudo chmod 0755 /etc/init.d/rc.local
#kill ztemtvcdromd
#sudo killall -9 ztemtvcdromd
if [ -d /usr/local/bin/ztemtApp/zteusbserial ] ; then
sudo /bin/rm -R /usr/local/bin/ztemtApp/zteusbserial
fi
#purge: Remove USB Driver
if [ -n "$(lsmod|grep ztemt)" ]; then
sudo /sbin/rmmod ztemt ;
fi
sudo /sbin/ldconfig
#Delete Setting.conf
/bin/rm -f /root/$SETTING_DATA_PATH/Setting.conf
/bin/rm -f /root/$SETTING_DATA_PATH/MultiUser.xml
/bin/rm -f /root/$SETTING_DATA_PATH/EVDOApp.pid
for ALLUSERPATH in `find /home -mount -maxdepth 1 -mindepth 1 -type d`;
do
if [ -d $ALLUSERPATH ] ; then
/bin/rm -f $ALLUSERPATH/$SETTING_DATA_PATH/Setting.conf
/bin/rm -f $ALLUSERPATH/$SETTING_DATA_PATH/MultiUser.xml
/bin/rm -f $ALLUSERPATH/$SETTING_DATA_PATH/EVDOApp.pid
fi
done
fi
#if [ "$1" = "purge" ] ; then
#fi
# End automatically added section
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment