NetExtender
Enviado por Tavo Rojas • 9 de Agosto de 2023 • Ensayo • 797 Palabras (4 Páginas) • 49 Visitas
#!/bin/bash
## install script for sonicwall sslvpn Linux client
function fix_pppd_perms
{
chmod -v u+s /usr/sbin/pppd
chmod -v a+x /usr/sbin/pppd
chmod -v a+rx /etc/ppp
chmod -v -R a+r /etc/ppp/peers
chmod -v a+x /etc/ppp/peers
}
if [ "$1" == "fixppp" ]
then
fix_pppd_perms
exit
fi
VERSION="10.2.839"
echo "--- SonicWall NetExtender $VERSION Installer ---"
USRLIB='/usr/lib'
LIB='/lib'
CABUNDLE='ca-bundle.crt'
if [[ "$*" =~ "--force-install" ]]
then
FORCE_INSTALL=1
fi
## FUNCTIONS ###########################################################
function check_64bit
{
# Are we on 64-bit architecture?
RE64='64-bit|64 bit'
if [[ "`uname -m`" =~ '64' ]]
then
# Is this NX package also 64-bit?
if [[ (! `file -b netExtender` =~ $RE64) && ($FORCE_INSTALL != 1) ]]
then
echo "ERROR: This copy of NetExtender is intended for 32-bit systems."
echo " Please install a copy of the 64-bit version of NetExtender."
exit
fi
# Is /usr/lib64 a directory?
if [ -d /usr/lib64 -a ! -L /usr/lib64 ]
then
USRLIB='/usr/lib64'
fi
# Is /lib64 a directory?
if [ -d /lib64 -a ! -L /lib64 ]
then
LIB='/lib64'
fi
elif [[ (`file -b netExtender` =~ $RE64) && ($FORCE_INSTALL != 1) ]]
then
echo "ERROR: This copy of NetExtender is intended for 64-bit systems."
echo " Please install a copy of the 32-bit version of NetExtender."
exit
fi
}
function exit_dependency_failure
{
echo
echo "-------------------------- INSTALLATION FAILED -------------------------"
echo
echo "Library dependencies must be resolved before NetExtender will be able to"
echo "operate correctly. Please resolve any dependencies listed above, then"
echo "try installing again."
echo
exit 1
}
function exit_ppp_missing
{
echo
echo "-------------------------- INSTALLATION FAILED -------------------------"
echo
echo "NetExtender requires a working installation of pppd. Please install"
echo "pppd and try again."
echo
exit 1
}
function exit_net_tools_missing
{
echo
echo "-------------------------- INSTALLATION FAILED -------------------------"
echo
echo "NetExtender requires working 'ifconfig' and 'route' and 'ip' utilities."
if [ -e /usr/bin/pacman ]
then
# ArchLinux
echo "You can install them by running 'pacman -S net-tools' as root,"
echo "then try installing NetExtender again."
fi
echo
exit 1
}
function exit_success
{
echo
echo "------------------------ INSTALLATION SUCCESSFUL -----------------------"
echo
echo "To launch NetExtender, do one of the following:"
echo
echo " 1. Click the NetExtender icon under the Applications menu"
echo " (look under the 'Internet' or 'Network' category)"
echo " or"
echo " 2. Type 'netExtenderGui'"
echo
exit 0
}
function assert_running_as_root
{
if [ "`id -u`" != "0" ]
then
echo "Please run the NetExtender installer as root."
echo "On many systems, you can use the sudo command:"
echo
echo " sudo ./install"
echo
exit 1
fi
}
function check_library_dependencies
{
echo "Checking library dependencies..."
MISSINGLIBS=`ldd netExtender | grep 'not found' | awk '{print $1}'`
if [ "$MISSINGLIBS" != "" ]
then
for i in $MISSINGLIBS
do
echo " Missing library: $i"
FULLNAME="$i"
LIBNAME=`echo $i | awk -F. '{print $1 }'`
ALT=`find $LIB -maxdepth 1 -name "$LIBNAME.so*" -type f | sed 's/\*//g' | sort -r | head -1`
if [ "$ALT" == "" ]
then
# Didn't find anything in $LIB ; try $USRLIB
ALT=`find $USRLIB -maxdepth 1 -name "$LIBNAME.so*" -type f | sed 's/\*//g' | sort -r | head -1`
fi
if [ "$ALT" != "" ]
then
echo " Found likely compatible version: $ALT"
REPLY='0'
while [ "$REPLY" != "y" -a "$REPLY" != "n" -a "$REPLY" != "Y" -a "$REPLY" != "N"
...