forked from vaslabs/pi-web-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·47 lines (43 loc) · 905 Bytes
/
setup.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
#!/bin/bash
#Version 0.2
#Description: setup tool for the pi-web-agent
#Author: Vasilis Nicolaou
called_from=$(pwd)
cd $(dirname $0)
VERSION=0.1
source setup_common
case $1 in
install)
[ $(id -u) -eq 0 ] || {
echo "You need to be root to run the setup"
exit 1
}
this_install
exit $?
;;
uninstall)
[ $(id -u) -eq 0 ] || {
echo "You need to be root to run the setup"
exit 1
}
this_uninstall
exit $?
;;
reinstall)
[ $(id -u) -eq 0 ] || {
echo "You need to be root to run the setup"
exit 1
}
this_reinstall
exit $?
;;
version)
echo "Version: $VERSION:"
exit 0
;;
*|?)
echo "Usage $0 <install|uninstall|reinstall>"
exit 1
;;
esac
cd $called_from