-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·73 lines (58 loc) · 1.91 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
#!/bin/bash
#
# Install script
MY_PATH=$(dirname "$0")
MY_PATH=$(cd "$MY_PATH" && pwd)
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "This script is meant only for use on the real fog drone."
echo " It might break your setup "
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
default=n
while true; do
[[ -t 0 ]] && { read -t 10 -n 2 -p $'\e[1;32mReally want to install? [y/n] (default: '"$default"$')\e[0m\n' resp || resp=$default ; }
response=$(echo $resp | sed -r 's/(.*)$/\1=/')
if [[ $response =~ ^(y|Y)=$ ]]
then
echo "source $MY_PATH/scripts/shell_additions.sh" >> ~/.bashrc
sudo apt install -y vim net-tools moreutils python3-colcon-common-extensions tmux
ln -sf "$MY_PATH/config/tmux.conf" ~/.tmux.conf
ln -sf "$MY_PATH/tmux/tmux.sh" ~/tmux.sh
break
elif [[ $response =~ ^(n|N)=$ ]]
then
break
else
echo " What? \"$resp\" is not a correct answer. Try y+Enter."
fi
done
# Ask about ssh keys
while true; do
[[ -t 0 ]] && { read -t 10 -n 2 -p $'\e[1;32mDo you want to update ssh keys? [y/n] (default: '"$default"$')\e[0m\n' resp || resp=$default ; }
response=$(echo $resp | sed -r 's/(.*)$/\1=/')
if [[ $response =~ ^(y|Y)=$ ]]
then
mkdir -p "$HOME"/.ssh
cp "$MY_PATH"/dotssh/* "$HOME"/.ssh
break
elif [[ $response =~ ^(n|N)=$ ]]
then
break
else
echo " What? \"$resp\" is not a correct answer. Try y+Enter."
fi
done
# Ask about udev rules
while true; do
[[ -t 0 ]] && { read -t 10 -n 2 -p $'\e[1;32mDo you want to update udev rules? [y/n] (default: '"$default"$')\e[0m\n' resp || resp=$default ; }
response=$(echo $resp | sed -r 's/(.*)$/\1=/')
if [[ $response =~ ^(y|Y)=$ ]]
then
sudo cp "$MY_PATH"/udev/* /etc/udev/rules.d/.
break
elif [[ $response =~ ^(n|N)=$ ]]
then
break
else
echo " What? \"$resp\" is not a correct answer. Try y+Enter."
fi
done