-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathinstall-client.sh
More file actions
executable file
·68 lines (58 loc) · 1.27 KB
/
install-client.sh
File metadata and controls
executable file
·68 lines (58 loc) · 1.27 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
68
#!/bin/sh
# -*- coding: utf-8 -*-
basedir="$(dirname "$(realpath "$0")")"
. "$basedir/scripts/lib.sh"
entry_checks()
{
[ -d "$target" ] || die "letmein is not built! Run ./build.sh"
[ "$(id -u)" = "0" ] || die "Must be root to install letmein."
}
install_dirs()
{
do_install \
-o root -g root -m 0755 \
-d /opt/letmein/bin
do_install \
-o root -g root -m 0755 \
-d /opt/letmein/etc
}
install_conf()
{
if [ -e /opt/letmein/etc/letmein.conf ]; then
do_chown root:root /opt/letmein/etc/letmein.conf
do_chmod 0644 /opt/letmein/etc/letmein.conf
else
do_install \
-o root -g root -m 0644 \
"$basedir/letmein/letmein.conf" \
/opt/letmein/etc/letmein.conf
fi
}
install_letmein()
{
do_install \
-o root -g root -m 0755 \
"$target/letmein" \
/opt/letmein/bin/
}
release="release"
while [ $# -ge 1 ]; do
case "$1" in
--debug|-d)
release="debug"
;;
--release|-r)
release="release"
;;
*)
die "Invalid option: $1"
;;
esac
shift
done
target="$basedir/target/$release"
entry_checks
install_dirs
install_conf
install_letmein
# vim: ts=4 sw=4 expandtab