-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.sh
executable file
·44 lines (37 loc) · 1.05 KB
/
build.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
#!/bin/bash
build () {
echo "# Building argo."
cd main
go build -o ../argo
echo "# Done."
}
if [ "$#" == 0 ]; then
build
fi
if [ "$1" == "--help" ]; then
echo "Usage: ./build.sh <flag>"
echo " --help This message."
echo " --build Builds argo."
echo " --install Installs argo. Must be run as root."
echo " --uninstall Removes argo. Must be run as root."
exit 0
fi
if [ "$1" == "--build" ]; then
build
fi
if [ "$1" == "--install" ]; then
echo "# Installing argo."
install -p -g root -o root -m 755 argo /usr/bin
install -p -g root -o root -m 644 actisense/actisense.rules /etc/udev/rules.d
install -p -g root -o root -m 644 canusb/canusb.rules /etc/udev/rules.d
install -p -g root -o root -m 755 actisense/actisense.sh /lib/udev/actisense
install -p -g root -o root -m 755 canusb/canusb.sh /lib/udev/canusb
fi
if [ "$1" == "--uninstall" ]; then
echo "# Removing argo."
rm /usr/bin/argo
rm /etc/udev/rules.d/actisense.rules
rm /etc/udev/rules.d/canusb.rules
rm /lib/udev/actisense
rm /lib/udev/canusb
fi