Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
310c5a43
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
310c5a43
编写于
7月 19, 2019
作者:
P
plum-lihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Modify the use of sudo commands]
上级
6524f9a1
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
34 addition
and
29 deletion
+34
-29
packaging/tools/remove.sh
packaging/tools/remove.sh
+34
-29
未找到文件。
packaging/tools/remove.sh
浏览文件 @
310c5a43
...
...
@@ -29,6 +29,11 @@ service_config_dir="/etc/systemd/system"
taos_service_name
=
"taosd"
nginx_service_name
=
"tdnginx"
csudo
=
""
if
command
-v
sudo
>
/dev/null
;
then
csudo
=
"sudo"
fi
function
is_using_systemd
()
{
if
pidof systemd &> /dev/null
;
then
return
0
...
...
@@ -43,45 +48,45 @@ fi
function
clean_bin
()
{
# Remove link
sudo
rm
-f
${
bin_link_dir
}
/taos
||
:
sudo
rm
-f
${
bin_link_dir
}
/taosd
||
:
sudo
rm
-f
${
bin_link_dir
}
/taosdump
||
:
sudo
rm
-f
${
bin_link_dir
}
/rmtaos
||
:
${
csudo
}
rm
-f
${
bin_link_dir
}
/taos
||
:
${
csudo
}
rm
-f
${
bin_link_dir
}
/taosd
||
:
${
csudo
}
rm
-f
${
bin_link_dir
}
/taosdump
||
:
${
csudo
}
rm
-f
${
bin_link_dir
}
/rmtaos
||
:
# Remove binary files
#
sudo
rm -rf ${bin_dir} || :
#
${csudo}
rm -rf ${bin_dir} || :
}
function
clean_lib
()
{
# Remove link
sudo
rm
-f
${
lib_link_dir
}
/libtaos.
*
||
:
${
csudo
}
rm
-f
${
lib_link_dir
}
/libtaos.
*
||
:
#
sudo
rm -f /usr/lib/libtaos.so || :
#
sudo
rm -rf ${lib_dir} || :
#
${csudo}
rm -f /usr/lib/libtaos.so || :
#
${csudo}
rm -rf ${lib_dir} || :
}
function
clean_header
()
{
# Remove link
sudo
rm
-f
${
inc_link_dir
}
/taos.h
||
:
${
csudo
}
rm
-f
${
inc_link_dir
}
/taos.h
||
:
#
sudo
rm -rf ${header_dir}
#
${csudo}
rm -rf ${header_dir}
}
function
clean_config
()
{
# Remove link
sudo
rm
-f
${
cfg_link_dir
}
/
*
||
:
#
sudo
rm -rf ${cfg_link_dir} || :
${
csudo
}
rm
-f
${
cfg_link_dir
}
/
*
||
:
#
${csudo}
rm -rf ${cfg_link_dir} || :
}
function
clean_log
()
{
if
grep
-e
'^\s*logDir.*$'
${
cfg_dir
}
/taos.cfg &> /dev/null
;
then
config_log_dir
=
$(
cut
-d
' '
-f2
<<<
$(
grep
-e
'^\s*logDir.*$'
${
cfg_dir
}
/taos.cfg
))
# echo "Removing log dir ${config_log_dir}......"
sudo
rm
-rf
${
config_log_dir
}
||
:
${
csudo
}
rm
-rf
${
config_log_dir
}
||
:
fi
# Remove link
sudo
rm
-rf
${
log_link_dir
}
||
:
sudo
rm
-rf
${
log_dir
}
||
:
${
csudo
}
rm
-rf
${
log_link_dir
}
||
:
${
csudo
}
rm
-rf
${
log_dir
}
||
:
}
function
clean_service_on_systemd
()
{
...
...
@@ -89,11 +94,11 @@ function clean_service_on_systemd() {
if
systemctl is-active
--quiet
${
taos_service_name
}
;
then
echo
"TDengine taosd is running, stopping it..."
sudo
systemctl stop
${
taos_service_name
}
&> /dev/null
||
echo
&> /dev/null
${
csudo
}
systemctl stop
${
taos_service_name
}
&> /dev/null
||
echo
&> /dev/null
fi
sudo
systemctl disable
${
taos_service_name
}
&> /dev/null
||
echo
&> /dev/null
${
csudo
}
systemctl disable
${
taos_service_name
}
&> /dev/null
||
echo
&> /dev/null
sudo
rm
-f
${
taosd_service_config
}
${
csudo
}
rm
-f
${
taosd_service_config
}
}
function
clean_service_on_sysvinit
()
{
...
...
@@ -101,13 +106,13 @@ function clean_service_on_sysvinit() {
if
pidof taosd &> /dev/null
;
then
echo
"TDengine taosd is running, stopping it..."
sudo
service taosd stop
||
:
${
csudo
}
service taosd stop
||
:
fi
sudo
sed
-i
"
\|
${
restart_config_str
}
|d"
/etc/inittab
||
:
sudo
rm
-f
${
service_config_dir
}
/taosd
||
:
sudo
update-rc.d
-f
taosd remove
||
:
sudo
init q
||
:
${
csudo
}
sed
-i
"
\|
${
restart_config_str
}
|d"
/etc/inittab
||
:
${
csudo
}
rm
-f
${
service_config_dir
}
/taosd
||
:
${
csudo
}
update-rc.d
-f
taosd remove
||
:
${
csudo
}
init q
||
:
}
function
clean_service
()
{
...
...
@@ -141,16 +146,16 @@ clean_log
# Remove configuration file
clean_config
# Remove data directory
sudo
rm
-rf
${
data_link_dir
}
||
:
${
csudo
}
rm
-rf
${
data_link_dir
}
||
:
[
"
$isAll
"
=
"false"
]
&&
exit
0
||
:
echo
-e
-n
"
${
RED
}
Do you want to delete data stored in TDengine? [y/N]:
${
NC
}
"
read
is_delete
while
true
;
do
if
[
"
${
is_delete
}
"
=
"y"
]
||
[
"
${
is_delete
}
"
=
"Y"
]
;
then
sudo
rm
-rf
${
data_dir
}
${
csudo
}
rm
-rf
${
data_dir
}
# echo "Removing data file ${config_data_dir}..."
[
-n
${
config_data_dir
}
]
&&
sudo
rm
-rf
${
config_data_dir
}
[
-n
${
config_data_dir
}
]
&&
${
csudo
}
rm
-rf
${
config_data_dir
}
break
elif
[
"
${
is_delete
}
"
=
"n"
]
||
[
"
${
is_delete
}
"
=
"N"
]
;
then
break
...
...
@@ -159,15 +164,15 @@ while true; do
fi
done
sudo
rm
-rf
${
install_main_dir
}
${
csudo
}
rm
-rf
${
install_main_dir
}
osinfo
=
$(
awk
-F
=
'/^NAME/{print $2}'
/etc/os-release
)
if
echo
$osinfo
|
grep
-qwi
"ubuntu"
;
then
# echo "this is ubuntu system"
sudo
rm
-f
/var/lib/dpkg/info/tdengine
*
||
:
${
csudo
}
rm
-f
/var/lib/dpkg/info/tdengine
*
||
:
elif
echo
$osinfo
|
grep
-qwi
"centos"
;
then
echo
"this is centos system"
sudo
rpm
-e
--noscripts
tdengine
||
:
${
csudo
}
rpm
-e
--noscripts
tdengine
||
:
fi
echo
-e
"
${
GREEN
}
TDEngine is removed successfully!
${
NC
}
"
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录