Skip to content

Commit

Permalink
Update APP-MANAGER
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-hc authored Feb 3, 2025
1 parent 4d67ea6 commit f922794
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion APP-MANAGER
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

AMVERSION="9.4.2-1"
AMVERSION="9.4.2-2"

# Determine main repository and branch
AMREPO="https://raw.githubusercontent.com/ivan-hc/AM/main"
Expand Down Expand Up @@ -942,11 +942,24 @@ _update_determine_apps_version_changes() {
fi
}

_update_torsocks_handler() {
torsocks_congif_file=$(find /etc -type f -name torsocks.conf 2>/dev/null)
if [ -n "$torsocks_congif_file" ]; then
if grep -q "^#AllowOutboundLocalhost 1" "$torsocks_congif_file"; then
[ ! -f "$AMDATADIR"/torsocks.conf ] && cat "$torsocks_congif_file" > "$AMDATADIR"/torsocks.conf
sed -i 's/^#AllowOutboundLocalhost 1/AllowOutboundLocalhost 1/g' "$AMDATADIR"/torsocks.conf
export TORSOCKS_CONF_FILE="$AMDATADIR"/torsocks.conf
sleep 1
fi
fi
}

_update_run_updater() {
if grep -q "api.github.com" "$argpath"/AM-updater; then
GH_API_ALLOWED=$(curl -Ls $HeaderAuthWithGITPAT https://api.github.com/repos/ivan-hc/AM/releases/latest | sed 's/[()",{} ]/\n/g' | grep "^ivan-hc" | head -1)
if [ -z "$GH_API_ALLOWED" ]; then
if command -v torsocks 1>/dev/null; then
_update_torsocks_handler
if [ -z "$debug_update" ]; then
torsocks "$argpath"/AM-updater >/dev/null 2>&1
else
Expand Down

0 comments on commit f922794

Please sign in to comment.