Skip to content

Commit 90e6d14

Browse files
committed
cleanup scripts
1 parent a28c857 commit 90e6d14

2 files changed

Lines changed: 0 additions & 60 deletions

File tree

scripts/proxy_set_linux_sh

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -142,46 +142,6 @@ detect_desktop_environment() {
142142
echo "unsupported"
143143
}
144144

145-
# Function to check if proxy is currently enabled for GNOME
146-
is_proxy_enabled() {
147-
local MODE=$(gsettings get org.gnome.system.proxy mode | tr -d "'")
148-
if [ "$MODE" == "none" ]; then
149-
echo "Proxy is currently disabled."
150-
else
151-
echo "Proxy is currently enabled."
152-
echo "Proxy Mode: $MODE"
153-
if [ "$MODE" == "manual" ]; then
154-
local HTTP_PROXY=$(gsettings get org.gnome.system.proxy.http host | tr -d "'")
155-
local HTTP_PORT=$(gsettings get org.gnome.system.proxy.http port)
156-
local IGNORE_HOSTS=$(gsettings get org.gnome.system.proxy ignore-hosts)
157-
echo "HTTP Proxy: $HTTP_PROXY:$HTTP_PORT"
158-
echo "Ignored Hosts: $IGNORE_HOSTS"
159-
fi
160-
fi
161-
}
162-
163-
# Fuction to check if proxy is currently enabled for KDE
164-
is_kde_proxy_enabled() {
165-
166-
# Determine the correct kwriteconfig command based on KDE_SESSION_VERSION
167-
if [ "$KDE_SESSION_VERSION" == "6" ]; then
168-
KWRITECONFIG="kwriteconfig6"
169-
else
170-
KWRITECONFIG="kwriteconfig5"
171-
fi
172-
173-
local PROXY_TYPE=$($KWRITECONFIG --file kioslaverc --group "Proxy Settings" --key ProxyType)
174-
if [ "$PROXY_TYPE" -eq 0 ]; then
175-
echo "Proxy is currently disabled."
176-
else
177-
echo "Proxy is currently enabled."
178-
local HTTP_PROXY=$($KWRITECONFIG --file kioslaverc --group "Proxy Settings" --key httpProxy)
179-
local IGNORE_HOSTS=$($KWRITECONFIG --file kioslaverc --group "Proxy Settings" --key NoProxyFor)
180-
echo "HTTP Proxy: $HTTP_PROXY"
181-
echo "Ignored Hosts: $IGNORE_HOSTS"
182-
fi
183-
}
184-
185145
# Main script logic
186146
if [ "$#" -lt 1 ]; then
187147
echo "Usage: $0 <mode> [proxy_ip proxy_port ignore_hosts]"

scripts/proxy_set_osx_sh

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -56,23 +56,6 @@ clear_proxy() {
5656
echo "Proxy for all network services has been disabled!"
5757
}
5858

59-
# Function to check if proxy is currently enabled
60-
is_proxy_enabled() {
61-
# Get all network service names
62-
SERVICES=$(networksetup -listallnetworkservices | grep -v '*')
63-
# Loop through each network service
64-
echo "$SERVICES" | while read -r SERVICE; do
65-
# Check if HTTP proxy is enabled
66-
HTTP_PROXY_STATE=$(networksetup -getwebproxy "$SERVICE" | grep "Enabled:" | awk '{print $2}' | grep -v 'Proxy')
67-
if [ "$HTTP_PROXY_STATE" == "Yes" ]; then
68-
echo "Proxy is currently enabled for network service '$SERVICE'"
69-
return 0
70-
fi
71-
done
72-
echo "Proxy is currently disabled for all network services"
73-
return 1
74-
}
75-
7659
# Main script logic
7760
if [ "$1" == "set" ]; then
7861
# Check if enough parameters are passed for setting proxy
@@ -83,12 +66,9 @@ if [ "$1" == "set" ]; then
8366
set_proxy "$2" "$3" "${@:4}"
8467
elif [ "$1" == "clear" ]; then
8568
clear_proxy
86-
elif [ "$1" == "check" ]; then
87-
is_proxy_enabled
8869
else
8970
echo "Usage:"
9071
echo " To set proxy: $0 set <IP Address> <Port> [Bypass Domain 1 Bypass Domain 2 ...]"
9172
echo " To clear proxy: $0 clear"
92-
echo " To check proxy status: $0 check"
9373
exit 1
9474
fi

0 commit comments

Comments
 (0)