-
Notifications
You must be signed in to change notification settings - Fork 1
/
make.sh
executable file
·61 lines (52 loc) · 1.24 KB
/
make.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
build() {
GOOS=linux go build || exit 1
}
build_turris() {
GOARCH=arm GOARM=7 build
}
redeploy() {
build
ssh $DDNSSERV '/etc/init.d/ddnsd stop'
scp go-ddnsd $DDNSSERV:/srv/ddnsd
ssh $DDNSSERV '/etc/init.d/ddnsd start'
ssh_logs
}
redeploy_turris() {
build_turris
DDNSSERV=turris
ssh $DDNSSERV '/etc/init.d/ddnsd stop'
scp go-ddnsd $DDNSSERV:/srv/ddnsd
ssh $DDNSSERV '/etc/init.d/ddnsd start'
ssh_logs
}
ssh_logs() {
ssh $DDNSSERV 'logread -f'
}
redeploy_service() {
scp ./etc/init.d/ddnsd $DDNSSERV:/etc/init.d/
}
test_dns() {
curl -X GET --location "http://dyn.jkl.mn:8080/nic/update?hostname=d1.dyn.jkl.mn&token=PASSWORD"
dig d1.dyn.jkl.mn
}
test_dns_loc() {
curl -X GET --location "http://localhost:8080/nic/update?hostname=d1.dyn.jkl.mn&token=PASSWORD"
dig d1.dyn.jkl.mn @127.0.0.1 -p 5354
}
progname=$(basename $0)
subcommand=$1
case $subcommand in
"" | "-h" | "--help")
help
;;
*)
shift
echo "Executing: $subcommand"
${subcommand} "$@"
if [ $? = 127 ]; then
echo "Error: '$subcommand' is not a known subcommand." >&2
echo " Run '$progname --help' for a list of known subcommands." >&2
exit 1
fi
;;
esac