This repository has been archived by the owner on Feb 8, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
update.sh
59 lines (41 loc) · 1.52 KB
/
update.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
#!/bin/bash
cd "$(cd -P -- "$(dirname -- "$0")" && pwd -P)"
echo "Backing up configuraton..."
echo "-------------------------------------------------------------------------------"
cp -vi config.yml config.bak
echo "Downloading GPG public key..."
echo "-------------------------------------------------------------------------------"
. "bin/recv-keys.sh"
echo "Updating lisk-rake..."
echo "-------------------------------------------------------------------------------"
mkdir -p tmp
cp -f config.bak tmp/
cd tmp
if ! command -v curl >/dev/null 2>&1 ; then
echo "Could not find curl. Please install 'curl' and try again."
exit
else
curl -L -o lisk-rake.tar.gz https://github.com/LiskHQ/lisk-rake/tarball/master
fi
if ! command -v tar >/dev/null 2>&1 ; then
echo "Could not find tar. Please install 'tar' and try again."
exit
else
tar -zxvf lisk-rake.tar.gz --strip 1
fi
if [ -f ./config.bak ] && [ -f ../config.bak ]; then
rm -rf ../*.*
cp -f *.* ../
fi
cd ..
#### "Installing ruby / gems..."
#### "-------------------------------------------------------------------------------"
. "bin/install_ruby.sh"
echo "Updating configuraton..."
echo "-------------------------------------------------------------------------------"
rvm lisk-rake-ruby@lisk-rake do ruby "bin/update_config.rb"
echo "Cleaning up..."
echo "-------------------------------------------------------------------------------"
rm -rf lisk-rake.tar.gz tmp
echo "Done."
echo "-------------------------------------------------------------------------------"