fix: create user if it doesn't exist
This commit is contained in:
parent
63967d4074
commit
902082200d
3 changed files with 11 additions and 5 deletions
1
.github/workflows/coverage.yml
vendored
1
.github/workflows/coverage.yml
vendored
|
@ -40,7 +40,6 @@ jobs:
|
||||||
if: matrix.version == 'stable' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request')
|
if: matrix.version == 'stable' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request')
|
||||||
uses: actions-rs/tarpaulin@v0.1
|
uses: actions-rs/tarpaulin@v0.1
|
||||||
with:
|
with:
|
||||||
version: '0.18.2'
|
|
||||||
args: '-t 1200'
|
args: '-t 1200'
|
||||||
env:
|
env:
|
||||||
# GIT_HASH is dummy value. I guess build.rs is skipped in tarpaulin
|
# GIT_HASH is dummy value. I guess build.rs is skipped in tarpaulin
|
||||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +1,2 @@
|
||||||
/target
|
/target
|
||||||
|
tarpaulin-report.html
|
||||||
|
|
|
@ -2,11 +2,17 @@
|
||||||
|
|
||||||
USER_ID=${LOCAL_USER_ID}
|
USER_ID=${LOCAL_USER_ID}
|
||||||
echo $USER_ID
|
echo $USER_ID
|
||||||
|
LIBREPAGES_USER=librepages
|
||||||
|
|
||||||
echo "Starting with UID : $USER_ID"
|
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
|
#adduser --disabled-password --shell /bin/bash --home $HOME --uid $USER_ID user
|
||||||
#--uid
|
#--uid
|
||||||
sudo useradd --uid $USER_ID -b /home -m -s /bin/bash user
|
|
||||||
su - user
|
if id "$1" &>/dev/null; then
|
||||||
pages
|
echo "User $LIBREPAGES_USER exists"
|
||||||
|
else
|
||||||
|
useradd --uid $USER_ID -b /home -m -s /bin/bash $LIBREPAGES_USER
|
||||||
|
fi
|
||||||
|
|
||||||
|
su $LIBREPAGES_USER -c 'pages'
|
||||||
|
|
Loading…
Add table
Reference in a new issue