aboutsummaryrefslogtreecommitdiff
path: root/newsboat/entrypoint.sh
diff options
context:
space:
mode:
Diffstat (limited to 'newsboat/entrypoint.sh')
-rwxr-xr-xnewsboat/entrypoint.sh31
1 files changed, 0 insertions, 31 deletions
diff --git a/newsboat/entrypoint.sh b/newsboat/entrypoint.sh
deleted file mode 100755
index 0e308cf..0000000
--- a/newsboat/entrypoint.sh
+++ /dev/null
@@ -1,31 +0,0 @@
1#!/bin/sh
2
3HOME_DIR="/home/newsboat/.newsboat"
4URLS_FILE="${HOME_DIR}/urls"
5
6# No point starting if they don't have config, also we don't
7# want to store the actual user data in the container so force
8# a mount.
9if [ ! -d $HOME_DIR ]; then
10 echo "Mount your newsboat config to /home/newsboat/.newsboat"
11 exit 1
12fi
13
14# Also force a urls file because this newsboat will just fail
15# anyhow without it.
16if [ ! -f $URLS_FILE ]; then
17 echo "Create a urls file in your newsboat config first"
18 exit 1
19fi
20
21# Allow users to specify the UID/GID in the environment but
22# default these to the existing owner of the files in their
23# mounted config, which should be sane.
24UID=${UID:-$(stat -c "%u" $URLS_FILE)}
25GID=${GID:-$(stat -c "%u" $URLS_FILE)}
26
27# Create the user and group
28addgroup -g ${GID} -S newsboat
29adduser -u ${UID} -S -h /home/newsboat -H -D -G newsboat newsboat
30
31/sbin/su-exec newsboat "$@"