-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate-server-universal.sh
More file actions
152 lines (135 loc) Β· 4.25 KB
/
update-server-universal.sh
File metadata and controls
152 lines (135 loc) Β· 4.25 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#!/bin/bash
# Update DigitalOcean server to serve universal installer
# Run this in your DigitalOcean console
echo "π Updating server to support universal installer..."
# Create the universal installer endpoint
cat > /var/www/html/universal << 'EOF'
#!/bin/bash
# BrandTrackers Universal Installer
# Works on ANY system with bash - no curl/wget required!
echo "π¬ BrandTrackers Universal Installer"
echo "π Detecting available download method..."
# The install script content to run
INSTALL_URL="https://cli.brandtrackers.xyz/install"
JOE_SCRIPT_URL="https://cli.brandtrackers.xyz"
# Function to download and execute with curl
try_curl() {
if command -v curl >/dev/null 2>&1; then
echo "β
Using curl"
curl -s "$JOE_SCRIPT_URL" | bash
return 0
fi
return 1
}
# Function to download and execute with wget
try_wget() {
if command -v wget >/dev/null 2>&1; then
echo "β
Using wget"
wget -qO- "$JOE_SCRIPT_URL" | bash
return 0
fi
return 1
}
# Function to download and execute with python3
try_python3() {
if command -v python3 >/dev/null 2>&1; then
echo "β
Using python3"
python3 -c "
import urllib.request
import subprocess
import sys
try:
with urllib.request.urlopen('$JOE_SCRIPT_URL') as response:
script_content = response.read().decode('utf-8')
subprocess.run(['bash'], input=script_content, text=True, check=True)
except Exception as e:
print(f'Error: {e}')
sys.exit(1)
"
return 0
fi
return 1
}
# Function to download and execute with python2 (legacy)
try_python2() {
if command -v python >/dev/null 2>&1; then
echo "β
Using python2 (legacy)"
python -c "
import urllib2
import subprocess
import sys
try:
response = urllib2.urlopen('$JOE_SCRIPT_URL')
script_content = response.read()
proc = subprocess.Popen(['bash'], stdin=subprocess.PIPE)
proc.communicate(input=script_content)
if proc.returncode != 0:
sys.exit(1)
except Exception as e:
print('Error: %s' % str(e))
sys.exit(1)
"
return 0
fi
return 1
}
# Function to show manual installation instructions
show_manual_install() {
echo "β No automatic download method available!"
echo ""
echo "π§ Manual Installation Options:"
echo ""
echo "1οΈβ£ Install a download tool first:"
echo " β’ macOS: curl is pre-installed"
echo " β’ Ubuntu/Debian: apt install curl"
echo " β’ CentOS/RHEL: yum install curl"
echo " β’ Alpine: apk add curl"
echo ""
echo "2οΈβ£ Or use git directly:"
echo " git clone https://github.com/yourusername/terminal-logo-animation"
echo " cd terminal-logo-animation"
echo " chmod +x joe-v2.sh"
echo " ./joe-v2.sh"
echo ""
echo "3οΈβ£ Or create the script manually:"
echo " Visit: https://raw.githubusercontent.com/yourusername/terminal-logo-animation/main/joe-v2.sh"
echo " Copy the content to a file, make executable, and run!"
echo ""
exit 1
}
# Try methods in order of preference and reliability
echo ""
if try_curl; then
echo "π Success! BrandTrackers logo executed via curl"
elif try_wget; then
echo "π Success! BrandTrackers logo executed via wget"
elif try_python3; then
echo "π Success! BrandTrackers logo executed via python3"
elif try_python2; then
echo "π Success! BrandTrackers logo executed via python2"
else
show_manual_install
fi
echo ""
echo "π Share these installation methods:"
echo ""
echo "π₯ Primary (most universal):"
echo " curl -s cli.brandtrackers.xyz | bash"
echo ""
echo "π₯ Alternative methods:"
echo " wget -qO- cli.brandtrackers.xyz | bash"
echo " python3 -c \"import urllib.request; exec(urllib.request.urlopen('https://cli.brandtrackers.xyz').read().decode())\""
echo ""
echo "π Universal installer (works on any system):"
echo " curl -s cli.brandtrackers.xyz/universal | bash"
EOF
# Make the universal installer executable
chmod +x /var/www/html/universal
# Test the setup
echo "β
Universal installer created at /var/www/html/universal"
echo ""
echo "π§ͺ Testing endpoints:"
echo " β’ Main script: curl -s cli.brandtrackers.xyz"
echo " β’ Universal: curl -s cli.brandtrackers.xyz/universal"
echo ""
echo "π Server update complete!"