Skip to content

Commit cee2b4c

Browse files
committed
phreaknet.sh: Minor logic fixes.
* Fix inverted package manager detection in fallback code. * Fix ODBC installation command ordering.
1 parent fa5934f commit cee2b4c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

phreaknet.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -320,14 +320,14 @@ elif [ ! -f /etc/debian_version ]; then # Default is Debian
320320
echoerr "Support for this platform ($OS_DIST_INFO) is limited... use at your own risk..."
321321

322322
# Try to automatically detect the right package manager, at least...
323-
if ! which "yum" > /dev/null; then
323+
if which "yum" > /dev/null; then
324324
PAC_MAN="yum"
325-
elif ! which "dnf" > /dev/null; then
325+
elif which "dnf" > /dev/null; then
326326
PAC_MAN="dnf"
327-
elif ! which "pkg" > /dev/null; then
327+
elif which "pkg" > /dev/null; then
328328
PAC_MAN="pkg"
329329
AST_SOURCE_PARENT_DIR="/usr/local/src"
330-
elif which "apt-get" > /dev/null; then # apt-get is default, so check last
330+
elif ! which "apt-get" > /dev/null; then # apt-get is default, so check last
331331
echoerr "Failed to automatically determine your package manager... script will likely fail"
332332
fi
333333
fi
@@ -2405,7 +2405,7 @@ install_odbc() {
24052405
# https://wiki.asterisk.org/wiki/display/AST/Getting+Asterisk+Connected+to+MySQL+via+ODBC
24062406
if [ "$PAC_MAN" = "apt-get" ]; then
24072407
# unixodbc is what contains isql
2408-
apt-get install -y unixodbc unixodbc-dev unixodbc-bin mariadb-server odbcinst
2408+
install_package "unixodbc unixodbc-dev odbcinst"
24092409
fi
24102410
cd $AST_SOURCE_PARENT_DIR
24112411
# http://www.unixodbc.org/ to get isql (if desired for manual testing)
@@ -2423,8 +2423,8 @@ install_odbc() {
24232423
fi
24242424
cp libmaodbc.so /usr/lib/x86_64-linux-gnu/odbc/
24252425
cp libmariadb.so /usr/lib/x86_64-linux-gnu/odbc/
2426-
rm mariadb-connector-odbc-$ODBC_VER-debian-buster-amd64.tar.gz
24272426
cd $AST_SOURCE_PARENT_DIR
2427+
rm mariadb-connector-odbc-$ODBC_VER-debian-buster-amd64.tar.gz
24282428
odbcinst -j
24292429
if [ $? -ne 0 ]; then
24302430
die "odbcinst failed"

0 commit comments

Comments
 (0)