-
Notifications
You must be signed in to change notification settings - Fork 4
/
install.sh
executable file
·87 lines (77 loc) · 2.51 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
80
81
82
83
84
85
86
87
#!/bin/bash
VERBOSE=false
# it can be also a name of the host
TIZEN_IP="192.168.41.64"
PACKAGE_DIR=
LAUNCH=false
# getopt section
TEMP=`getopt -o v,h,i:,d:,l --long verbose,help,tizen-ip:,package-dir:,launch -n 'flash.sh' -- "$@"`
eval set -- "$TEMP"
while true; do
case "$1" in
-v|--verbose)
shift;
VERBOSE=true
;;
-l|--launch)
shift;
LAUNCH=true
;;
-h|--help)
shift;
echo "usage $0 -h -b -v"
exit 0
;;
-i|--tizen-ip)
TIZEN_IP=$2
shift 2;
;;
-d|--package-dir)
PACKAGE_DIR=$2
shift 2;
;;
--)
shift;
break;
;;
esac
done
red=`tput setaf 1`
green=`tput setaf 2`
reset=`tput sgr0`
yell() { echo "$0: $*" >&2; }
die() { yell "$*"; exit 111; }
try() { "$@" || die "cannot $*"; }
unalias gbs > /dev/null 2>&1
# remove all rpms from target
echo "${red}Cleaning previous installation${reset}"
# clean all previous packages
ssh root@$TIZEN_IP zypper -n -q rm navit
ssh root@$TIZEN_IP zypper -n -q rm navit-debugsource
ssh root@$TIZEN_IP zypper -n -q rm navit-debuginfo
ssh root@$TIZEN_IP zypper -n -q rm gpsd
ssh root@$TIZEN_IP zypper -n -q rm gpsd-devel
ssh root@$TIZEN_IP zypper -n -q rm libdbus-c++
ssh root@$TIZEN_IP zypper -n -q rm qt5-qtwayland
ssh root@$TIZEN_IP zypper -n -q rm nxe
ssh root@$TIZEN_IP zypper -n -q rm nxe-debuginfo
ssh root@$TIZEN_IP zypper -n -q rm nxe-debugsource
ssh root@$TIZEN_IP rm /root/navit_packages -rf
try ssh root@$TIZEN_IP mkdir -p /root/navit_packages/
try scp $PACKAGE_DIR/gpsd-*.rpm root@$TIZEN_IP:/root/navit_packages/
try scp $PACKAGE_DIR/libdbus-c++-*.rpm root@$TIZEN_IP:/root/navit_packages/
try scp $PACKAGE_DIR/qt5-qtwayland-*.rpm root@$TIZEN_IP:/root/navit_packages/
try scp $PACKAGE_DIR/navit-*.rpm root@$TIZEN_IP:/root/navit_packages/
try scp $PACKAGE_DIR/nxe-*.rpm root@$TIZEN_IP:/root/navit_packages/
try ssh root@$TIZEN_IP rpm -ivh /root/navit_packages/gpsd*.rpm
try ssh root@$TIZEN_IP rpm -ivh /root/navit_packages/libdbus*.rpm
try ssh root@$TIZEN_IP rpm -ivh /root/navit_packages/qt5-qtwayland*.rpm
try ssh root@$TIZEN_IP rpm -ivh /root/navit_packages/navit*.rpm
try ssh root@$TIZEN_IP rpm -ivh /root/navit_packages/nxe*.rpm
ssh root@$TIZEN_IP rm /root/navit_packages -rf
ssh app@$TIZEN_IP killall mapdownloader
ssh app@$TIZEN_IP rm /home/app/.NavIt -rfv
ssh app@$TIZEN_IP rm /home/app/.navit -rfv
if [ "$LAUNCH" == true ]; then
ssh app@$TIZEN_IP XDG_RUNTIME_DIR=/run/user/5000 QT_WAYLAND_DISABLE_WINDOWDECORATION=1 nxe-app
fi