Skip to content

Commit d388a52

Browse files
author
jupengfei
committed
卸载脚本删除整个bashrc文件
Change-Id: I440e4d2eb856f832e5c7199b5456132c305f2cd9
1 parent e8531e9 commit d388a52

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

install.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ install_init_script () {
3737
sed -i "${line}d" $user_bashrc
3838
fi
3939

40-
echo -n >> $user_bashrc
4140
echo "$bashrc_cmd" >> $user_bashrc
4241
}
4342

unisntall.sh

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
#!/bin/bash
22

3-
local_path=`pwd`/$(dirname $0)
43
user_bashrc=$HOME/.bashrc
54

6-
bashrc_cmd="source $local_path/rd_init"
7-
if grep $bashrc_cmd $user_bashrc 1>/dev/null 2>/dev/null; then
8-
echo "Deleting init bashrc......"
9-
line=`grep -n "$bashrc_cmd" $user_bashrc|cut -d: -f1`
10-
sed -i "${line}d" $user_bashrc
11-
fi
5+
echo "Deleting init bashrc......"
6+
sed -i "/rd_init/d" $user_bashrc
7+
sed -i "/rd_server/d" $user_bashrc
128

139
echo "Uninstall Success"

0 commit comments

Comments
 (0)