-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupgrade_Yona.sh
71 lines (61 loc) · 1.99 KB
/
upgrade_Yona.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
#!/bin/bash
# Script Version 20170504 by Minishanell
# Setting for YONA_DATA
YONA_DATA=/home/pi/yona_data
# Check of Yona_Version
echo ""
YONANOW=`ls -al | awk '/^d/{print $NF}' |grep yona-`
YONAINSTALLED="1"
if [ $YONANOW ]; then
echo -e "\033[33m Currunt Yona's Version : "$YONANOW;
echo -e "\033[0m";
YONAINSTALLED="1";
else
echo -e "\033[31m Yona is Not Installed.";
echo -e "\033[0m";
YONAINSTALLED="0";
fi
# Choice for Upgrade by Keyboard Input
read -n 1 -p "Do you want to Yona Upgrade(y/N)?"
echo "";echo ""
if [[ $REPLY = [yY] ]]; then
echo -e "\033[33m Now, Yona will be Upgrade.";
echo -e "\033[0m";
if [ $YONAINSTALL ]
then
# # Sync & Shutdown Yona
sudo sync;
sudo sleep 1;
sudo pid=`ps -ef | grep java | grep com.typesafe.play | awk '{print $2}'`;
sudo kill $pid;
sudo sync;
sudo sleep 1;
echo -e "\033[32m Yona is Shutdowned.";
echo -e "\033[0m";
fi
# Paser for Latest Version Yona Address Link
wget https://github.com/yona-projects/yona/releases/latest
cat ./latest | grep '\<href="/yona.*.bin.zip\>' | grep -v 'h2' | cut -f 2 -d "\"" > downlink.yona
rm ./latest
INPUT=`cat ./downlink.yona`
echo "https://github.com"$INPUT > downlink.yona
INPUT=`cat ./downlink.yona`
# Print Link Address
echo "Link Address :" $INPUT
echo ""
# Download & Unzip Latest Version Yona
wget $INPUT
unzip ./yona*.zip
rm ./yona*.zip
else
echo -e "\033[31m Yona Upgrade is cancel.";
echo -e "\033[0m";
fi
# Make a NewFolder Name
INPUT=`cat downlink.yona | cut -f 8 -d "/" | sed 's/v/-/g'`
echo "yona"$INPUT > version.yona
# Run Yona
#INPUT=`cat version.yona`
#cd ./$INPUT
#export YONA_DATA
#sudo ./bin/yona&