This repository has been archived by the owner on Jan 3, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·65 lines (56 loc) · 2.04 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
#! /bin/bash
# root check
if [ $EUID -ne 0 ]; then
echo "please just run this with root, thx"
exit 1
fi
if [[ $1 == "-p" ]] || [[ $1 == "--preserve" ]]; then
preserve="t"
elif [ $# -eq 0 ]; then
#ngl, do nothing, its just to stop it from having an error
echo "HINT: reinstalling? run with -p or --preserve to preserve the currently present backend and web code"
else
echo "unknown args"
exit 2
fi
# make sure the directories are present
if [ ! -d /apps ]; then
mkdir /apps
fi
if [ ! -d /apps/bin ]; then
mkdir /apps/bin
fi
if [ ! -d /apps/AprilTags ]; then
mkdir /apps/AprilTags
fi
# clean out alll of the odd stuff that could be in the AprilTags dir
if ! [[ $preserve == "t" ]]; then
rm -rf /apps/AprilTags/*
fi
# again, just like with the uninstall, it should properly do the /apps/bin stuff based on what is here, but whatever works!
if [ -f /apps/bin/AprilTags.sh ]; then
rm /apps/bin/AprilTags.sh
fi
if [ -f /apps/bin/libAprilTags.sh ]; then
rm /apps/bin/libAprilTags.sh
fi
# copy the service to the services, refresh, then enable it
cp AprilTagsPipeline.service /etc/systemd/system
sudo chmod 755 /etc/systemd/system/AprilTagsPipeline.service
systemctl daemon-reload
systemctl enable AprilTagsPipeline.service
# add path modification in /etc/profile.d/ if not already there
# why two? idk. it just apparently should have both?
if [ ! -f /etc/profile.d/AddAppsToPaf.sh ]; then
cp AddAppsToPaf.sh /etc/profile.d/AddAppsToPaf.sh
fi
if [ ! -f /etc/profile.d/AddAppsToPaf.csh ]; then
cp AddAppsToPaf.sh /etc/profile.d/AddAppsToPaf.csh
fi
# now onto the AprilTags specific items
cp -R AprilTags/ /apps/
cp bin/* /apps/bin/
echo "The AprilTags service has been installed and enabled. Run 'AprilTags.sh --update all' in the Cuda project root to sync it to be run."
echo "HINT: program not found error? run 'export PATH=\$PATH:/apps/bin' in your session"
echo "HINT: if sudo will not work, try sudo -i or use the sudo with the binary absolute path (which is required for some commands)"
# adding the commands in the AddAppstoPaf might help to fix that issue