forked from arter97/immich-native
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathuninstall.sh
More file actions
32 lines (26 loc) · 725 Bytes
/
uninstall.sh
File metadata and controls
32 lines (26 loc) · 725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
IMMICH_PATH=/opt/services/immich
REALUSER=$(who am i | cut -f 1 -d ' ')
function deleteUser {
echo "INFO: deleting user"
dscl . -delete "/Users/immich" && \
dscl . -delete "/Groups/immich"
}
function uninstallDaemons {
echo "INFO: uninstalling daemons"
launchctl unload -w /Library/LaunchDaemons/com.immich.machine.learning.plist
launchctl unload -w /Library/LaunchDaemons/com.immich.plist
rm -f /Library/LaunchDaemons/com.immich*plist
}
function deletePostgresUser {
echo "INFO: deleting postgres user"
sudo -u $REALUSER psql postgres << EOF
drop database immich;
drop user immich;
EOF
}
uninstallDaemons
deleteUser
deletePostgresUser
echo "INFO: deleting $IMMICH_PATH"
rm -rf $IMMICH_PATH