Repository navigation
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·68 lines (54 loc) · 1.76 KB
/
Copy pathdeploy.sh
File metadata and controls
executable file
·68 lines (54 loc) · 1.76 KB
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
#!/bin/sh
ROOTDIR="$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
EMERGENCY_BUTTON_SERVER_DIR="$ROOTDIR/EmergencyButtonServer"
EMERGENCY_BUTTON_AVR_DIR="$ROOTDIR/EmergencyButtonEmbedded"
FREETZ_DIR="$EMERGENCY_BUTTON_SERVER_DIR/external/freetz-ng"
OUTPUT_DIR="$ROOTDIR/output"
NCPU="$(cat /proc/cpuinfo | grep processor | wc -l)"
TARGET=$1
test -n "$TARGET" || {
echo "Please specify a target"
}
deploy_button () {
#TODO
}
deploy_freetz () {
echo "Is freetz-ng already running on your Fritz!Box? [y/N]"
read ANSWER
test -n "$ANSWER" || ANSWER=N
ANSWER=$(echo "$ANSWER" | tr 'a-z' 'A-Z')
if test "$ANSWER" = "Y" ; then
echo "Then please log onto the freetz-ng interface, i.e. http://10.0.0.1:81, and deploy the image there."
echo "The default login credentials are:"
echo "Username: admin"
echo "Password: freetz"
else
echo "Set up your NIC to have the static IP 192.168.178.2/24"
echo "Press any button to continue"
read
$FREETZ_DIR/tools/push_firmware || {
echo "Failed to push firmware, did you build freetz-ng already?"
}
fi
}
deploy_server () {
echo "Please specify the address of your freetz-ng router"
read ADDRESS
test -n "$ADDRESS" || {
echo "No address specified, exiting.."
return
}
echo "Please specify the password of freetz' root user (\"freetz\" when empty)"
read PASSWD
test -n "$PASSWD" || PASSWD="freetz"
scp "$OUTPUT_DIR/emergency_button_server" "root@$ADDRESS:/usr/bin/"
}
if test "$TARGET" = "freetz" ; then
deploy_freetz
#elif test "$TARGET" = "server" ; then
# deploy_server
elif test "$TARGET" = "button" ; then
deploy_button
else
echo "Unknown target: $TARGET"
fi