-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·79 lines (58 loc) · 1.04 KB
/
install.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
APP_NAME="flutter_run_cat"
RELEASE="https://github.com/yoehwan/flutter_run_cat/releases/download/v1.0.1/"
RELEASE_NAME="Run.Cat.v1.0.1.x64.linux.tar.xz"
OUTPUT="/usr/lib/$APP_NAME"
init()
{
echo "Start Install RunCat..."
}
killPS(){
echo "kill Process...."
if pgrep -x "$APP_NAME" >/dev/null
then
sudo pkill $APP_NAME
fi
}
download()
{
echo "Download New Release...."
file=$RELEASE$RELEASE_NAME
if [ ! -f "$RELEASE_NAME" ] ; then
if [ -x "$(which wget)" ] ; then
echo "download wget."
wget $file
elif [ -x "$(which curl)" ] ; then
echo "download curl."
else
echo "Could not find curl or wget, please install one."
fi
fi
}
unzip()
{
echo "UnZip Download File...."
if [ ! -f "$OUTPUT" ] ; then
sudo mkdir -p $OUTPUT
fi
tar --overwrite -xvf $RELEASE_NAME -C "$OUTPUT"
rm $RELEASE_NAME
}
addBin()
{
echo "Add Binery...."
cd /usr/bin && sudo ln -sf $OUTPUT/$APP_NAME $APP_NAME
}
completed()
{
echo "
Install Completed!
Run commnd 'flutter_run_cat' in cmd.
"
}
init
killPS
download
unzip
addBin
completed