Skip to content
This repository was archived by the owner on Nov 8, 2021. It is now read-only.

Commit 14b648d

Browse files
mvanbaakmichaelwittig
authored andcommitted
Dont fail when pkill has no processes to kill. Fixes #66 (#67)
1 parent 4c111c3 commit 14b648d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

import_users.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,12 @@ function create_or_update_local_user() {
169169

170170
function delete_local_user() {
171171
# First, make sure no new sessions can be started
172-
/usr/sbin/usermod -L -s /sbin/nologin "${1}"
172+
/usr/sbin/usermod -L -s /sbin/nologin "${1}" || true
173173
# ask nicely and give them some time to shutdown
174-
/usr/bin/pkill -15 -u "${1}"
174+
/usr/bin/pkill -15 -u "${1}" || true
175175
sleep 5
176176
# Dont want to close nicely? DIE!
177-
/usr/bin/pkill -9 -u "${1}"
177+
/usr/bin/pkill -9 -u "${1}" || true
178178
sleep 1
179179
# Remove account now that all processes for the user are gone
180180
/usr/sbin/userdel -f -r "${1}"

0 commit comments

Comments
 (0)