We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3ee8580 + b0b6e19 commit 739a7f2Copy full SHA for 739a7f2
files/runScanner.sh
@@ -6,14 +6,24 @@ if [[ $NAME == *" "* ]]; then
6
exit -1
7
fi
8
9
-if [[ -z ${UID} ]]; then
10
- UID=1000
+if [[ -z {$NAME} ]]; then
+ $NAME="Scanner"
11
+fi
12
+
13
+# if running as root, create default user. If UID is set, use that
14
+if [[ ${UID} == 0 ]]; then
15
+ USERID=1000
16
+else
17
+ USERID=$UID
18
19
if [[ -z ${GID} ]]; then
- GID=1000
20
+ GROUPID=1000
21
22
+ GROUPID=$GID
23
-groupadd --gid "$GID" NAS
-adduser "$NAME" --uid $UID --gid "$GID" --disabled-password --force-badname --gecos ""
24
25
+groupadd --gid "$GROUPID" NAS
26
+adduser "$NAME" --uid $USERID --gid "$GROUPID" --disabled-password --force-badname --gecos ""
27
mkdir -p /scans
28
chmod 777 /scans
29
touch /var/log/scanner.log
0 commit comments