forked from alexjustesen/speedtest-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunas-user
More file actions
47 lines (37 loc) · 1.25 KB
/
runas-user
File metadata and controls
47 lines (37 loc) · 1.25 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
#!/command/with-contenv bash
PUID=${PUID:-9999}
PGID=${PGID:-9999}
WEBUSER_HOME=${WEBUSER_HOME:-"/var/www/html"}
if [[ $PUID != 9999 || $PGID != 9999 ]]; then
# Change the group ID
groupmod -o -g "$PGID" webgroup
# Change the User ID
usermod -o -u "$PUID" webuser
# Make sure the home directory is updated with the proper UID & GID
chown webuser:webgroup $WEBUSER_HOME
fi
if [[ $S6_LOGGING != 1 ]]; then
echo '
--------------------------------------------------------------------
_______ __ __ __
| __|.-----.-----.-----.--| | |_.-----.-----.| |_
|__ || _ | -__| -__| _ | _| -__|__ --|| _|
|_______|| __|_____|_____|_____|____|_____|_____||____|
|__|
_______ __
|_ _|.----.---.-.----.| |--.-----.----.
| | | _| _ | __|| <| -__| _|
|___| |__| |___._|____||__|__|_____|__|
--------------------------------------------------------------------'
echo '
To support Speedtest Tracker visit:
https://github.com/alexjustesen/speedtest-tracker
-------------------------------------
GID/UID
-------------------------------------'
echo "
User uid: $(id -u webuser)
User gid: $(id -g webuser)
-------------------------------------
"
fi