35 lines
752 B
Bash
Executable File
35 lines
752 B
Bash
Executable File
#!/bin/sh
|
|
set -e
|
|
|
|
cleanup_managed_tailscale() {
|
|
marker="/var/lib/autonomy-studio/managed-tailscale"
|
|
[ -f "$marker" ] || return 0
|
|
grep -q "installed_by=autonomy-studio-launcher" "$marker" || return 0
|
|
|
|
systemctl stop tailscaled 2>/dev/null || true
|
|
apt-get remove -y tailscale 2>/dev/null || true
|
|
rm -f "$marker"
|
|
}
|
|
|
|
cleanup_apps_dir() {
|
|
apps_dir="$1/.local/share/autonomy-studio/apps"
|
|
[ -d "$apps_dir" ] || return 0
|
|
|
|
find "$apps_dir" -maxdepth 1 -type f \( \
|
|
-name "*.AppImage" -o \
|
|
-name "*.AppImage.version" -o \
|
|
-name "*.download" \
|
|
\) -delete
|
|
|
|
rmdir "$apps_dir" 2>/dev/null || true
|
|
}
|
|
|
|
cleanup_managed_tailscale
|
|
|
|
for home_dir in /home/*; do
|
|
[ -d "$home_dir" ] || continue
|
|
cleanup_apps_dir "$home_dir"
|
|
done
|
|
|
|
exit 0
|