fix: create user if it doesn't exist

This commit is contained in:
Aravinth Manivannan 2022-08-15 19:26:28 +05:30
parent 63967d4074
commit 902082200d
Signed by: realaravinth
GPG Key ID: AD9F0F08E855ED88
3 changed files with 11 additions and 5 deletions

View File

@ -40,7 +40,6 @@ jobs:
if: matrix.version == 'stable' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request')
uses: actions-rs/tarpaulin@v0.1
with:
version: '0.18.2'
args: '-t 1200'
env:
# GIT_HASH is dummy value. I guess build.rs is skipped in tarpaulin

1
.gitignore vendored
View File

@ -1 +1,2 @@
/target
tarpaulin-report.html

View File

@ -2,11 +2,17 @@
USER_ID=${LOCAL_USER_ID}
echo $USER_ID
LIBREPAGES_USER=librepages
echo "Starting with UID : $USER_ID"
export HOME=/home/user
export HOME=/home/$LIBREPAGES_USER
#adduser --disabled-password --shell /bin/bash --home $HOME --uid $USER_ID user
#--uid
sudo useradd --uid $USER_ID -b /home -m -s /bin/bash user
su - user
pages
if id "$1" &>/dev/null; then
echo "User $LIBREPAGES_USER exists"
else
useradd --uid $USER_ID -b /home -m -s /bin/bash $LIBREPAGES_USER
fi
su $LIBREPAGES_USER -c 'pages'