-
Notifications
You must be signed in to change notification settings - Fork 27
/
InstallToUbuntu.sh
executable file
·39 lines (37 loc) · 893 Bytes
/
InstallToUbuntu.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
########################################
#This is easy install QDK to ubuntu tool
########################################
if [ -d "/usr/share/QDK" ]; then
echo "QDK exists."
else
apt-get update
apt-get install -y build-essential wget bsdmainutils curl python openssl rsync
fi
case "$1" in
install)
echo "Compiler QPKG encrypt"
cd src
make
cd ../
echo "Install QDK"
cp -rf ./shared /usr/share/QDK
[ -d "/etc/config" ] || mkdir "/etc/config"
cp ./shared/qdk.conf /etc/config
sed -e '2d' ./shared/qdk.conf > /etc/config/qdk.conf
sed -i '2iQDK_PATH_P=/usr/share' /etc/config/qdk.conf
echo "PATH=$PATH:/usr/share/QDK/bin" >> ~/.bashrc
source ~/.bashrc
;;
remove)
echo "Remove QDK"
rm -rf "/etc/config/qdk.conf"
rm -rf "/usr/share/QDK"
sed -i '/QDK/d' ~/.bashrc
source ~/.bashrc
;;
*)
echo "Usage: $0 {install|remove}"
exit 1
esac
exit 0