-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathentrypoint
executable file
·58 lines (42 loc) · 1.13 KB
/
entrypoint
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
#!/usr/bin/env bash
#
# Copyright 2017 - 2018 Ternaris
# SPDX-License-Identifier: Apache 2.0
set -e
if [[ -n "$GITLAB_CI" ]]; then
exec "$@"
fi
if [[ -n "$DEBUG" ]]; then
set -x
fi
if [[ -n "$TIMEZONE" ]]; then
echo "$TIMEZONE" > /etc/timezone
ln -sf /usr/share/zoneinfo/"$TIMEZONE" /etc/localtime
dpkg-reconfigure -f noninteractive tzdata
fi
groupdel "$GROUP" &>/dev/null || true
groupadd -og "$GROUP_ID" "$GROUP"
useradd -M -u "$USER_ID" -g "$GROUP_ID" -d "/home/$USER" -s /bin/bash "$USER"
groupdel video &> /dev/null || true
groupadd -og "${VIDEO_GROUP_ID}" video
gpasswd -a "${USER}" video
for x in /etc/skel/.*; do
target="/home/$USER/$(basename "$x")"
if [[ ! -e "$target" ]]; then
cp -a "$x" "$target"
chown -R "$USER":"$GROUP" "$target"
fi
done
if [[ -z "$SKIP_ADEINIT" ]]; then
for x in /opt/*; do
if [[ -x "$x/.adeinit" ]]; then
echo "Initializing $x"
sudo -Hu "$USER" -- bash -lc "$x/.adeinit"
echo "Initializing $x done"
fi
done
fi
# Enable multicast on loopback interface for ros localhost only
sudo ip link set lo multicast on
echo 'ADE startup completed.'
exec "$@"