-
Notifications
You must be signed in to change notification settings - Fork 1
/
deploy-to-device.sh
executable file
·57 lines (39 loc) · 1 KB
/
deploy-to-device.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
#!/bin/bash
# written by Michael Maier (s.8472@aon.at)
#
# 18.01.2019 - intial release
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2 as published by the Free Software Foundation.
###
### Standard help text
###
target_path="/var/www/ng/"
if [ ! "$1" ] || [ "$1" = "-h" ] || [ "$1" = " -help" ] || [ "$1" = "--help" ]
then
cat <<EOH
Usage: $0 [OPTIONS] {target} [path]
$0 is a program to deploy the compiled code to a device (param 1)
the compiled code will be scp'd to \$TARGET:\$path
OPTIONS:
-h -help --help this help text
{target} hostname, required
[path] optional (defaults to $target_path)
EOH
exit
fi
###
### variables
###
TARGET="$1"
if [ "$2" ]; then
target_path="$2"
fi
###
### working part
###
ssh root@$TARGET mkdir -p $target_path
echo scp -r dist/Web/* root@$TARGET:$target_path
scp -r dist/Web/* root@$TARGET:$target_path
ssh root@$TARGET systemctl restart kiosk