diff options
author | Jakob Stendahl <jakob.stendahl@outlook.com> | 2018-10-18 13:13:27 +0200 |
---|---|---|
committer | Jakob Stendahl <jakob.stendahl@outlook.com> | 2018-10-18 13:13:27 +0200 |
commit | f36d99a3c960b7d6eaf95e23bea49dc02f1f3ae6 (patch) | |
tree | 8a81725bcbcd78d5b08ba6b4dcd78df51ee7b27d | |
parent | 2a0d442014041e0f4a0c6aed5a02980ab770cfce (diff) | |
download | Luxcena-Neo-f36d99a3c960b7d6eaf95e23bea49dc02f1f3ae6.tar.gz Luxcena-Neo-f36d99a3c960b7d6eaf95e23bea49dc02f1f3ae6.zip |
:construction: Add sudo to runuser, just continue if user exists
-rwxr-xr-x | bin/install.sh | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/bin/install.sh b/bin/install.sh index e227b88..24526f2 100755 --- a/bin/install.sh +++ b/bin/install.sh @@ -109,8 +109,7 @@ tput sgr0 username="lux-neo" sudo egrep "^$username" /etc/passwd >/dev/null if [ $? -eq 0 ]; then - echo "$username exists!" - exit 1 + echo "User already exists, continuing..." else #pass=$(perl -e 'print crypt($ARGV[0], "password")' $password) sudo useradd -m $username @@ -144,7 +143,7 @@ printf '%s\n' " - Running npm i..." tput sgr0 tput sc export NODE_ENV=production || { printf "\n\nInstall failed.\n"; exit 1; } -runuser -l $username -c "npm --prefix ~/install/src install ~/install/src --only=production || { printf "\n\nInstall failed.\n"; exit 1; }" # This is probably a bit overkill to have --only=... but better safe than sorry? +sudo runuser -l $username -c "npm --prefix ~/install/src install ~/install/src --only=production || { printf "\n\nInstall failed.\n"; exit 1; }" # This is probably a bit overkill to have --only=... but better safe than sorry? tput rc; tput ed # Fifth we add the service files |