Skip to content

Commit ddf5fff

Browse files
committed
Correct user deletion with all its data
Actually it is not necessary to remove particularly the local-ai data directory before user deletion. It will be accomplished automatically by the userdel command. But it is crucial to remove additional users from the local-ai group to allow userdel command to delete the group itself.
1 parent ab02217 commit ddf5fff

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

docs/static/install.sh

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,10 @@ uninstall_localai() {
137137
fi
138138
done
139139

140-
# Remove models directory
141-
if [ -d "/var/lib/local-ai" ]; then
142-
info "Removing LocalAI data directory..."
143-
$SUDO rm -rf /var/lib/local-ai
144-
fi
145-
146-
# Remove local-ai user if it exists
140+
# Remove local-ai user and all its data if it exists
147141
if id local-ai >/dev/null 2>&1; then
148-
info "Removing local-ai user..."
142+
info "Removing local-ai user and all its data..."
143+
$SUDO gpasswd -d $(whoami) local-ai
149144
$SUDO userdel -r local-ai || true
150145
fi
151146

0 commit comments

Comments
 (0)