#!/bin/bash

if [ "$(id -u)" != "0" ]; then
echo "Insufficient permissions. Use sudo or root account." 1>&2
exit 1
fi

my_default_prompt=0
if test "$#" != "0"; then
if test "$#" != "1" -o "$1" != "--force"; then
echo "Error: Unknown argument(s): $*"
echo ""
echo "Usage: uninstall.tool [--force]"
echo ""
echo "If the '--force' option is not given, you will be prompted"
echo "for a Yes/No before doing the actual uninstallation."
echo ""
exit 4;
fi
my_default_prompt="Yes"
fi

if test "$my_default_prompt" != "Yes"; then
echo "Do you wish to uninstall EslErlang (Yes/No)?"
read my_answer
if test "$my_answer" != "Yes" -a "$my_answer" != "YES" -a "$my_answer" != "yes"; then
echo "Aborting uninstall. (answer: '$my_answer')".
exit 2;
fi
echo ""
fi

echo "Removing files"

for p in "com.erlang-solutions.Erlang" "com.erlang-solutions.Erlang.Updater"; do

FILES=`/usr/sbin/pkgutil --files ${p} 2>/dev/null`
for s in $FILES; do
if [ -f "/${s}" -o -h "/${s}" ]; then
rm "/${s}" #if s is dir it will not be removed
fi
done

#reverse oreder becouse if dir A has empty dir B then A cannot be removed and when we reverse
#we get the dippest directory first so everything works

DIRS=`/usr/sbin/pkgutil --files ${p} 2>/dev/null --only-dirs | awk '{x = $0 "\n" x} END {printf "%s", x}'`
for d in $DIRS; do
if [ -d "/${d}" ]; then
rmdir "/${d}" 2>/dev/null
fi
done

echo "Cleaning up"

pkgutil --forget $p 2>/dev/null

done

osascript -e 'tell application "System Events" to delete login item "EslErlangUpdater"' 2>/dev/null

 

echo "Uninstallation completed"

erlang mac os 10.9 卸载脚本的更多相关文章

  1. 解锁 vmware esxi 6.7 并安装 mac os 10.13

    1.安装 esxi 6.7 2.下载 unlocker 2.1.1.zip 3.上传 unlocker 2.1.1.zip esxi的磁盘中 4.开启esxi的ssh登录 5.使用 ssh 登录 es ...

  2. Mac OS 10.12 - 安装Homebrew,像Ubuntu里面的apt一样简单地安装和删除软件!

    Homebrew — macOS 不可或缺的套件管理器,Homebrew官方网站如此介绍自己!!! 中文官网:https://brew.sh/index_zh-cn.html 一,安装 打开shell ...

  3. 虚拟机(VMware12 pro)安装Mac OS 10.10

    下载VMware12pro,Mac OS 10.10.ios,虚拟机破解: 在虚拟机中创建新虚拟机://http://cdnnn.07net01.com/linux/2016/01/1130384.h ...

  4. mac os 10.10上安装my eclipse显示virtual memory不足,解决方案

    mac os 10.10上安装my eclipse显示virtual memory不足,安装失败. 自从把OS 升级到10.10 之后, 各种问题, 安装的时候向导提示提示我们说没有足够的虚拟内存, ...

  5. [xUnix 开发环境--01] MAMP mac os 10.10 配置经历、要点——01. phpmyadmin连不上

    Mac OS 10.10已经自带了apache2和php(php的路径我至今还没不知道,太懒没去找) 用brew安装mysql, 在官网上下载了phpmyadmin,按官方方式配置完后,登录不上,也不 ...

  6. Mac OS 10.10 Yosemite正式版怎么升级 升级教程

    苹果在2014年10月17号凌晨一点召开了新品发布会,推出了新的 iPad.iMac 产品,以及大家一直所期盼的 Mac OS 10.10 正式版系统.个人是从 Mac OS 10.10 的第一个测试 ...

  7. win下vm10+mac os 10.9安装遇到问题

    在windows 8下安装vm10.0.0+mac os 10.9遇到问题记录例如以下: 一.因为之前我装的vm9+mac os 10.7: 二.准备安装mac os 10.9,把vm9换成vm10: ...

  8. VMware15安装MAC(MAC OS 10.13)(OS X 10.14)原版可升级最新可解锁macOS Unlocker3.0(OS X 10.13)

      目录树 1.1.2安装环境: 1.1.3所需资源: 1.1.4 Unlocker 3.0解锁 1.1.5 配置环境 1.1.6开始安装 1.1.7开启虚拟机进入MAC安装界面 1.1.8 macO ...

  9. VirtualBox虚拟机安装Mac OS 10.12

    注:本文作者  (QQ:85805214) 本博主只是转载发布而已. VMware 安装Mac OS 方法 由于Virtual Box拷贝文件比较麻烦,有时候经常出现拷贝失败的情况,故使用VMware ...

随机推荐

  1. No module named django.core

    在虚拟环境中将django-admin.py startproject tango_with_django_project替换为django-admin startproject tango_with ...

  2. 高版本api在低版本中的兼容

    直接上例子,看如何避免crash. eg:根据给出路径,获取此路径所在分区的总空间大小. 文档说明:获取文件系统用量情况,在API level 9及其以上的系统,可直接调用File对象的相关方法,以下 ...

  3. centos6.7设置非root帐户自动登录

    1.在/etc/gdm/custom.conf文件中修改并加入以下这段 [daemon]AutomaticLogin=你的用户名AutomaticLoginEnable=True 2.重启 reboo ...

  4. String类的compareTo()方法的源码解析

    private final char value[]; 字符串会自动转换为一个字符数组. public int compareTo(String anotherString) { //this -- ...

  5. Python 字符串操作及string模块使用

    python的字符串操作通过2部分的方法函数基本上就可以解决所有的字符串操作需求: python的字符串属性函数 python的string模块 1.字符串属性方法操作: 1.>字符串格式输出对 ...

  6. SameSite Cookie,防止 CSRF 攻击

    因为 HTTP 协议是无状态的,所以很久以前的网站是没有登录这个概念的,直到网景发明 cookie 以后,网站才开始利用 cookie 记录用户的登录状态.cookie 是个好东西,但它很不安全,其中 ...

  7. sql 查询

    select * from (select * ,row_number() over(partition by CreateUID order by asid)num from AuctionSell ...

  8. JAVA的i++, i+=1, i=i+1有区别吗?

    看一些JAVA基础题的时候,经常看到这个问题,很多人的解释是:i++最快,i+=1其次,i=i+1最慢.下面通过Sun JDK编译出来的字节码验证一下这个问题. 为了让编译出来的字节码便于阅读,将这三 ...

  9. command shell 的知识整理

    cmd 也是shell  windowns的外壳一种. 查看文件和文件夹 dir mkdir *** 创建文件夹 rd *** 删除文件夹(应该有参数的,递归之类的)CTR+C 终止命令 cd> ...

  10. $.prop()和$.attr() 区别用法

    都用于读取和设置DOM元素节点的属性 不同: $.attr()用于DOM元素本身的属性 $.prop()用于DOM节点对应的JS属性(源于DOM元素到JS对象的映射) 源于两者在jquery类库的实现 ...