1414# See the License for the specific language governing permissions and
1515# limitations under the License.
1616
17- # dbdeployer installer version 1 .0.0 - Released 2020-12-29
17+ # dbdeployer installer version 2 .0.0 - Updated 2026-03-24
1818# Usage:
19- # curl -s https://github.com/datacharmer/dbdeployer/master/scripts/dbdeployer-install.sh | bash
20- # or
21- # curl -L -s https://bit.ly/dbdeployer | bash
19+ # curl -s https://github.com/ProxySQL/dbdeployer/master/scripts/dbdeployer-install.sh | bash
2220
2321# Quality set for bash scripts:
2422# [set -e] fails on error
3129set -o pipefail
3230
3331# File containing latest version of dbdeployer
34- version_file=https://github.com/datacharmer /dbdeployer/master/common/VERSION
32+ version_file=https://github.com/ProxySQL /dbdeployer/master/common/VERSION
3533
3634# check_exit_code checks the return code of the previous command
3735# exits the script if it is non-zero
9290fi
9391
9492OS=$( uname -s | tr ' [:upper:]' ' [:lower:]' )
93+ ARCH=$( uname -m)
9594
9695# (STEP 4) checks the operating system
9796# Only Linux and MacOS are recognized
@@ -101,29 +100,40 @@ then
101100 exit 1
102101fi
103102
103+ # Normalize architecture
104+ case " $ARCH " in
105+ x86_64|amd64) ARCH=amd64 ;;
106+ aarch64|arm64) ARCH=arm64 ;;
107+ * )
108+ echo " Architecture '$ARCH ' not supported"
109+ exit 1
110+ ;;
111+ esac
112+
104113# While "darwin" is what the system itself returns,
105114# "osx" is the identifier in dbdeployer binaries
115+ OS_LABEL=$OS
106116if [ " $OS " == " darwin" ]
107117then
108- OS =osx
118+ OS_LABEL =osx
109119fi
110120
111121# Base URL for dbdeployer downloads
112- origin=https://github.com/datacharmer /dbdeployer/releases/download/v${dbdeployer_version}
122+ origin=https://github.com/ProxySQL /dbdeployer/releases/download/v${dbdeployer_version}
113123
114124# Name of the archive we are looking for
115- filename=dbdeployer-${dbdeployer_version} .${OS } .tar.gz
125+ filename=dbdeployer-${dbdeployer_version} .${OS_LABEL} _ ${ARCH } .tar.gz
116126
117- # Name of the file containing the checksum
118- checksum_file=${filename} .sha256
127+ # Name of the file containing the checksums
128+ checksum_file=checksums.txt
119129
120130# Name of the executable inside the archive
121- ultimate_file=dbdeployer- ${dbdeployer_version} . ${OS}
131+ ultimate_file=dbdeployer
122132
123133# (STEP 5) Checks for already existing files.
124134# If any of the files that we need to download exist already,
125135# the program terminates
126- for existing in $filename $checksum_file $ultimate_file
136+ for existing in $filename $checksum_file
127137do
128138 if [ -f " $existing " ]
129139 then
156166 exit 1
157167fi
158168
159- # (STEP 10) probes the checksum
160- shasum -c " ${ checksum_file} "
161- check_exit_code " shasum -c $checksum_file "
169+ # (STEP 10) probes the checksum (extract the line for our file from checksums.txt)
170+ grep " $filename " " $checksum_file " | shasum -a 256 -c -
171+ check_exit_code " shasum -c for $filename "
162172
163173# (STEP 11) unpacks the archive
164174tar -xzf " $filename "
@@ -176,7 +186,7 @@ chmod +x "${ultimate_file}"
176186check_exit_code " chmod +x ${ultimate_file} "
177187
178188# (STEP 14) shows the downloaded files
179- ls -lh " ${ultimate_file} " " ${checksum_file} " " ${ filename}"
189+ ls -lh " ${ultimate_file} " " ${filename} "
180190target=" "
181191
182192# local_targets are the places where a non-privileged user could store the executable
0 commit comments