forked from beeper/linkedin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-run.sh
More file actions
executable file
·31 lines (25 loc) · 827 Bytes
/
docker-run.sh
File metadata and controls
executable file
·31 lines (25 loc) · 827 Bytes
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
#!/bin/sh
[ -z $CONFIG_PATH ] && CONFIG_PATH="/data/config.yaml"
[ -z $REGISTRATION_PATH ] && REGISTRATION_PATH="/data/registration.yaml"
# Define functions.
function fixperms {
chown -R $UID:$GID $CONFIG_PATH $REGISTRATION_PATH
}
cd /opt/linkedin-matrix
if [ ! -f $CONFIG_PATH ]; then
cp example-config.yaml $CONFIG_PATH
sed -i "s#hostname: localhost#hostname: 0.0.0.0#" $CONFIG_PATH
echo "Didn't find a config file."
echo "Copied default config file to $CONFIG_PATH"
echo "Modify that config file to your liking."
echo "Start the container again after that to generate the registration file."
fixperms
exit
fi
if [ ! -f $REGISTRATION_PATH ]; then
python3 -m linkedin_matrix -g -c $CONFIG_PATH -r $REGISTRATION_PATH
fixperms
exit
fi
fixperms
exec su-exec $UID:$GID python3 -m linkedin_matrix -c $CONFIG_PATH