В линуксе я новичёк. Проблема такая: в наличии есть "нетбук SAMSUNG NC-110 LINUX MINT NADYA Cinnamon" и "модем ZTE AC5730 SKYLINK с дровами на борту". Как подружить эти девайсы между собой???
Дело в том что ни дисков, ни папок на модеме система не видит... Через windows копировал с модема всё что там есть, а есть там следующее:
дрова
1) папка LINUX в ней:
а) 7zr - исполняемый (application/x-executable), открыть не удалось
б) install - инструкции по установке программы (text/x-install)
#!/bin/sh
# Written by YANGYONG, 2011-10-9
# Defined Common Funcitons
echo_pause()
{
echo "Any Key to Continue ..."
read -n1 tmp
}
echo_exit()
{
echo "Any Key to Exit ..."
read -n1 tmp
exit 11
}
echo_rootright()
{
if [ ! `whoami` = "root" ] ; then
echo ""
echo "Warning: You must run the process by 'root' user"
echo " Try: sudo \"$0\" "
echo "Process Terminated !"
echo ""
exit
fi
}
echo_platform()
{
#Define a var: PLATFORM, value is: Ubuntu, Fedora and openSUSE
if [ -f /etc/SuSE-release ] ; then
PLATFORM=`grep openSUSE /etc/SuSE-release 2>&1 | awk -F ' ' '{printf $1}'`
else
PLATFORM=`grep Ubuntu /etc/issue 2>&1 | awk -F ' ' '{printf $1}'`
if [ "${PLATFORM}" != "Ubuntu" ] ; then
PLATFORM=`grep Fedora /etc/issue 2>&1 | awk -F ' ' '{printf $1}'`
fi
fi
if [ "${PLATFORM}" = "grep:" ] ; then
echo "... ERROR: Not Found Platform! "
else
echo "... Current linux release version is '$PLATFORM' "
fi
}
#打包的安装程序目录, default is 'ztemtApp'
ZTEMTAPP_NAME="ztemtApp"
#Install Dir, default is '/usr/local/bin/ztemtApp'
DEST_DIR=/usr/local/bin/$ZTEMTAPP_NAME
# 打包的配置数据目录,default is 'ztemtApp-1.0'
ZTEMTDATA_NAME="ztemtApp-1.0"
# Fedora and opSuSE config files, default is 'autoinstall'
AUTOINSTALL_NAME="autoinstall"
#linux drive source directory name, default is 'zteusbserial'
USB_SERIAL_NAME="zteusbserial"
#linux drive dll name, default is 'ztemt.ko'
DRIVER_MODULE_NAME="ztemt"
DRIVER_MODULE_FILENAME="ztemt.ko"
#Service Name, default is 'ztemtvcdromd'
SERVICE_NAME="ztemtvcdromd"
#Shortcut Name, default is 'ztemtapp'
SHORTCUT_NAME="ztemtapp"
#Device Rules File Name, default is '10-ztemtEVDO.rules'
DEVICE_RULES_NAME="10-ztemtEVDO.rules"
#Device Insert Callback Shell File Name, defaul is 'ztemtEVDO.sh'
#DEVICE_INSERT_CALLBACK="ztemtEVDO.sh"
#User App Data Dir Name, default is '.ztemtapp/ZTEEVDO'
USER_APPDATA_DIR=".ztemtapp/ZTEEVDO"
#Install file name: default is 'install'
INSTALL_FILENAME="install"
#Uninstall file name: default is 'uninstall'
UNINSTALL_FILENAME="uninstall"
#Current Path: this file work PWD
CURRENT_PATH=`echo $0 | sed 's/\/'${INSTALL_FILENAME}'$//'`
#Data card log file: defaul is '/tmp/ztemt_datacard_logfile.txt'
LOGFILE_PATH="/tmp/ztemt_datacard_logfile.txt"
echo_rootright
echo_platform > /dev/null
echo "Current linux release version is '$PLATFORM'" >> $LOGFILE_PATH
cd $CURRENT_PATH
echo "Current Path is : $CURRENT_PATH : $PWD" | tee -a $LOGFILE_PATH
set -e
#fedora 9 cann't find command 'pidof'
PATH=$PATH:/sbin
echo "1. Checking Previous Version ... " | tee -a $LOGFILE_PATH
# stop service
if [ "$PLATFORM" = "Ubuntu" ] ; then
if [ -n "$(pidof $SERVICE_NAME)" ]; then
sudo killall -9 $SERVICE_NAME
echo " ... Killed service '$SERVICE_NAME'" | tee -a $LOGFILE_PATH
fi
else
if [ -n "$($(which pidof) $SERVICE_NAME)" ]; then
if [ -f "/etc/init.d/$SERVICE_NAME" ] ; then
sudo /etc/init.d/$SERVICE_NAME stop
rm -f /etc/init.d/$SERVICE_NAME
echo " ... Stopped service '$SERVICE_NAME' "
fi
fi
fi
echo "2. Copying Data Bin ... " | tee -a $LOGFILE_PATH
echo " ... will take a few seconds, please waiting ..."
#echo_pause
#1. common files
#all files
./7zr x -y -o/usr/local/bin ${ZTEMTAPP_NAME}.bin > /dev/null
#config data
cp -Rpd /usr/local/bin/$ZTEMTDATA_NAME/* /
rm -rf /usr/local/bin/$ZTEMTDATA_NAME
#2. files only for openSUSE and Fedora
#ip-up.local
cp /usr/local/bin/$AUTOINSTALL_NAME/ip-up.local $DEST_DIR
#service script and default usb-serial driver bin
if [ "$PLATFORM" = "openSUSE" ] ; then
cp -f /usr/local/bin/$AUTOINSTALL_NAME/suse/$SERVICE_NAME /etc/init.d/
cp -f /usr/local/bin/$AUTOINSTALL_NAME/suse/$DRIVER_MODULE_FILENAME $DEST_DIR
elif [ "$PLATFORM" = "Fedora" ] ; then
cp -f /usr/local/bin/$AUTOINSTALL_NAME/fedora/$SERVICE_NAME /etc/init.d/
cp -f /usr/local/bin/$AUTOINSTALL_NAME/fedora/$DRIVER_MODULE_FILENAME $DEST_DIR
fi
rm -rf /usr/local/bin/$AUTOINSTALL_NAME
echo "3. Auto Load Usb Driver Module ... " | tee -a $LOGFILE_PATH
# YG_ openSUSE execute error!, ?
if [ "$PLATFORM" = "Ubuntu" ] ; then
sudo /etc/init.d/acpid restart
fi
if [ "${PLATFORM}" = "Ubuntu" ] ; then
# daemon31: start daemon by udev rules
#echo "/usr/sbin/$SERVICE_NAME" >> /etc/init.d/rc.local
echo "insmod $DEST_DIR/$USB_SERIAL_NAME/$DRIVER_MODULE_FILENAME" >> /etc/init.d/rc.local
fi
echo "4. Changing pppd Options ... " | tee -a $LOGFILE_PATH
file="/etc/ppp/options"
#echo $file
if [ -f "$file" ] ; then
{
mv -f /etc/ppp/options /etc/ppp/options_bk
touch /etc/ppp/options
echo 'noauth' >> /etc/ppp/options
}
else
{
touch /etc/ppp/options
echo 'noauth' >> /etc/ppp/options
}
fi
chown root /usr/sbin/pppd
chmod 4755 /usr/sbin/pppd
echo "5. Changing File Permission ... " | tee -a $LOGFILE_PATH
sudo /bin/chmod 0755 $DEST_DIR/bin/App
sudo /bin/chmod 0755 $DEST_DIR/loopPlayWav
sudo /bin/chmod 0755 /usr/bin/$SHORTCUT_NAME
sudo /bin/chown root /usr/sbin/$SERVICE_NAME
sudo /bin/chmod 4755 /usr/sbin/$SERVICE_NAME
sudo /bin/chmod 0644 /etc/udev/rules.d/$DEVICE_RULES_NAME
#sudo /bin/chmod 0755 /lib/udev/$DEVICE_INSERT_CALLBACK
sudo /bin/chmod 0755 $DEST_DIR/$UNINSTALL_FILENAME
#Used by openSUSE and Fedora
if [ -f /etc/init.d/$SERVICE_NAME ] ; then
sudo /bin/chmod 0775 /etc/init.d/$SERVICE_NAME
fi
echo "6. Detecting Qt lib Version ... " | tee -a $LOGFILE_PATH
QT_MAJOR=""
QT_MINOR=""
QT_BUILD=""
QT_VERSION=""
if [ "$PLATFORM" = "Ubuntu" ] ; then
QT_PKG_NAME=`dpkg -s libqtgui4 2>&1 |grep Version: |cut -d: -f2|cut -d- -f1|sed 's/[ ]*//'`
#Version: 4.4.0-1ubuntu5~hardy1
if [ "$QT_PKG_NAME" = "" ]; then
echo " ... Package 'libqtgui4' is not installed"
QT_PKG_NAME="0.0.0"
else
echo " ... Package 'libqtgui4' exist"
fi
else
QT_PKG_NAME=`rpm -q libqt5 | cut -de -f1`
#CrossPlatformUI-V2.2.3.i586; package *** is not install
if [ "$QT_PKG_NAME" = "packag" ]; then
echo " ... Package 'libqt5' is not installed"
QT_PKG_NAME="0.0.0"
QT_PKG_NAME=`rpm -q libqt4 | cut -de -f1`
if [ "$QT_PKG_NAME" = "packag" ]; then
echo " ... Package 'libqt4' is not installed"
QT_PKG_NAME="0.0.0"
else
echo " ... Package 'libqt4' has been installed in this system."
QT_PKG_NAME=`rpm -q libqt4 | cut -d- -f2 |sed 's/[ ]*//'`
fi
else
echo " ... Package 'libqt5' has been installed."
QT_PKG_NAME=`rpm -q libqt5 | cut -d- -f2 | sed 's/[ ]*//'`
fi
fi
echo " ... QT_VERSION = $QT_PKG_NAME"
#common part
QT_MAJOR=`echo $QT_PKG_NAME | cut -d. -f1`
QT_MINOR=`echo $QT_PKG_NAME | cut -d. -f2`
QT_BUILD=`echo $QT_PKG_NAME | cut -d. -f3`
if [ "$QT_MAJOR" -gt "4" ]; then
sudo rm -f $DEST_DIR/bin/libQt*
elif [ "$QT_MAJOR" -eq "4" ]; then
if [ "$QT_MINOR" -gt "4" ]; then
sudo rm -f $DEST_DIR/bin/libQt*
elif [ "$QT_MINOR" -eq "4" ]; then
if [ "$QT_BUILD" -gt "0" ]; then
sudo rm -f $DEST_DIR/bin/libQt*
fi
fi
fi
sudo /sbin/ldconfig
#Add ip-up.local script for openSUSE and Fedora
if [ "$PLATFORM" != "Ubuntu" ] ; then
sudo rm -f /etc/ppp/resolv.conf > /dev/null
sudo rm -f /var/run/ppp/resolv.conf > /dev/null
if [ -f /etc/ppp/ip-up.local ]; then
if [ -f /etc/ppp/ip-up.local.bakup ]; then
echo " ... /etc/ppp/ip-up.local.bakup exists."
else
sudo mv /etc/ppp/ip-up.local /etc/ppp/ip-up.local.bakup
fi
fi
sudo cp $DEST_DIR/ip-up.local /etc/ppp/
sudo chmod 755 /etc/ppp/ip-up.local
fi
echo "7. Deleting process id file: EVDOApp.pid ... " | tee -a $LOGFILE_PATH
if [ -e ~/$USER_APPDATA_DIR/EVDOApp.pid ]; then
/bin/rm -f ~/$USER_APPDATA_DIR/EVDOApp.pid
fi
echo "8. Making USB Serial Driver Module : $DRIVER_MODULE_FILENAME ... " | tee -a $LOGFILE_PATH
echo " ... will take a few seconds, please waiting ..." | tee -a $LOGFILE_PATH
#echo_pause
UNAME=`uname -r|cut -d. -f3|cut -d- -f1`
if [ $UNAME -eq "27" ]; then
cd $DEST_DIR/$USB_SERIAL_NAME/2.6.27; make
elif [ $UNAME -lt "27" ]; then
cd $DEST_DIR/$USB_SERIAL_NAME/below2.6.27; make
elif [ $UNAME -eq "28" ]; then
cd $DEST_DIR/$USB_SERIAL_NAME/2.6.28; make
elif [ $UNAME -eq "29" ]; then
cd $DEST_DIR/$USB_SERIAL_NAME/2.6.29; make
elif [ $UNAME -eq "30" ]; then
cd $DEST_DIR/$USB_SERIAL_NAME/2.6.30; make
elif [ $UNAME -eq "31" ]; then
cd $DEST_DIR/$USB_SERIAL_NAME/2.6.31; make
elif [ $UNAME -eq "32" ]; then
cd $DEST_DIR/$USB_SERIAL_NAME/2.6.32; make
elif [ $UNAME -eq "33" ]; then
cd $DEST_DIR/$USB_SERIAL_NAME/2.6.33; make
elif [ $UNAME -eq "34" ]; then
cd $DEST_DIR/$USB_SERIAL_NAME/2.6.34; make
elif [ $UNAME -eq "35" ]; then
cd $DEST_DIR/$USB_SERIAL_NAME/2.6.35; make
elif [ $UNAME -eq "36" ]; then
cd $DEST_DIR/$USB_SERIAL_NAME/2.6.36; make
elif [ $UNAME -eq "37" ]; then
cd $DEST_DIR/$USB_SERIAL_NAME/2.6.37; make
elif [ $UNAME -eq "38" ]; then
cd $DEST_DIR/$USB_SERIAL_NAME/2.6.38; make
elif [ $UNAME -eq "39" ]; then
cd $DEST_DIR/$USB_SERIAL_NAME/2.6.39; make
else
echo "Information: Your linux version(2.6.${UNAME}) don't need usb-serial driver! "
fi
if [ -f ./$DRIVER_MODULE_FILENAME ]; then
mv $DRIVER_MODULE_FILENAME ..
make clean
#Delete default driver file ztemt.ko
rm ../../$DRIVER_MODULE_FILENAME
else
echo "Sorry! Make usb-serial driver error."
echo "But, it try to use the default driver module."
mv $DEST_DIR/$DRIVER_MODULE_FILENAME $DEST_DIR/$USB_SERIAL_NAME
fi
echo "9. Checking ALSA Library ... " | tee -a $LOGFILE_PATH
if [ -f /lib/libasound.so.2 ]; then
LIB_ALSA="/lib/libasound.so.2"
else
if [ -f /usr/lib/libasound.so.2 ]; then
LIB_ALSA="/usr/lib/libasound.so.2"
else
echo "WARNING: Can not find ALSA shared library, which is needed for the program."
fi
fi
echo "10. Checking libaudio2 Library ... " | tee -a $LOGFILE_PATH
if [ -f /lib/libaudio.so.2 ]; then
LIB_AUDIO2="/lib/libaudio.so.2"
else
if [ -f /usr/lib/libaudio.so.2 ]; then
LIB_AUDIO2="/usr/lib/libaudio.so.2"
else
echo "WARNING: Can not find libaudio2 shared library, which is needed for the program."
fi
fi
echo "11. Loading Usb-serial Driver Module if not loaded ..." | tee -a $LOGFILE_PATH
if [ "${PLATFORM}" = "Ubuntu" ] ; then
if [ -z "$(pidof $SERVICE_NAME)" ]; then
sudo /usr/sbin/$SERVICE_NAME
echo " ... Started service '$SERVICE_NAME'"
fi
if [ -z "$( lsmod | grep $DRIVER_MODULE_NAME )" ]; then
sudo /sbin/insmod $DEST_DIR/$USB_SERIAL_NAME/$DRIVER_MODULE_FILENAME
echo " ... Loaded usb-serial driver"
else
{
# stop usb-serial driver
lsmod | grep ^$DRIVER_MODULE_NAME >> $LOGFILE_PATH
NUM=`lsmod | grep ^$DRIVER_MODULE_NAME | awk '{print $3}'`
echo $NUM >> $LOGFILE_PATH
if [ $NUM -gt 0 ] ; then
echo " ... WARNING: usb-serial driver is in use ! " | tee -a $LOGFILE_PATH
echo " ... Please re-insert the CDMA terminal or restart your system "
echo ""
exit
else
sudo /sbin/rmmod $DRIVER_MODULE_NAME ;
fi
}
fi
else
/sbin/chkconfig --add $SERVICE_NAME
/etc/init.d/$SERVICE_NAME start
if [ -n "$($(which pidof) $SERVICE_NAME)" ]; then
echo " ... Loaded service: usb-serial driver and cdrom-switch "
fi
fi
echo ""
echo "Please re-insert the CDMA terminal after installation complete!" | tee -a $LOGFILE_PATH
echo ""
в) sysconfig.dat - текстовый документ (text/plain)
name=CrossPlatformUI
version=2.3.5
г) ztemtApp.bin - неизвестно (application/octet-stream), открыть не удалось.
2)autorun.sh - сценарий оболочки UNIX (application/x-shellscript)
#!/bin/bash
CURRENT_PATH=`echo $0 | sed 's/autorun.sh//'`
echo_rootright()
{
if [ ! `whoami` = "root" ] ; then
echo "****************************************************"
echo "Warning: You must run the process by 'root' user !"
echo " Try: sudo \"$0\" "
echo ""
echo "Process Terminated "
echo "****************************************************"
exit
fi
}
echo_rootright
sh "${CURRENT_PATH}"/install_linux
3) Autorun.ico - значок Microsoft (image/vnd.microsoft.icon)
4) Autorun.inf - Setup Information (application/x-wine-extension-inf)
5) CrossPlatformUI-V2.3.5-Skylink.dmg - образ диска Apple Mac OS X (application/x-apple-diskimage)
6) Setup.exe - исполняемый файл DOS/Windows (application/x-ms-dos-executable)
7) install_linux - сценарий оболочки UNIX (application/x-shellscript)
#!/bin/sh
# Written by YANGYONG, 2011-10-17
# Defined Common Funcitons
echo_pause()
{
echo "Any Key to Continue ..."
read -n1 tmp
}
echo_exit()
{
echo "Any Key to Exit ..."
read -n1 tmp
exit 11
}
echo_rootright()
{
if [ ! `whoami` = "root" ] ; then
echo ""
echo "Warning: You must run the process by 'root' user"
echo " Try: sudo \"$0\" "
echo "Process Terminated !"
echo ""
exit
fi
}
echo_platform()
{
#Define a var: PLATFORM, value is: Ubuntu, Fedora and openSUSE
if [ -f /etc/SuSE-release ] ; then
PLATFORM=`grep openSUSE /etc/SuSE-release 2>&1 | awk -F ' ' '{printf $1}'`
else
PLATFORM=`grep Ubuntu /etc/issue 2>&1 | awk -F ' ' '{printf $1}'`
if [ "${PLATFORM}" != "Ubuntu" ] ; then
PLATFORM=`grep Fedora /etc/issue 2>&1 | awk -F ' ' '{printf $1}'`
fi
fi
if [ "${PLATFORM}" = "grep:" ] ; then
echo "... ERROR: Not Found Platform! "
else
echo "... Current linux release version is '$PLATFORM' "
fi
}
#打包的安装程序目录, default is 'ztemtApp'
ZTEMTAPP_NAME="ztemtApp"
#Install file name: default is 'install'
INSTALL_FILENAME="install"
#Uninstall file name: default is 'uninstall'
UNINSTALL_FILENAME="uninstall"
#Current work path
CURRENT_PATH=`echo $0 | sed 's/\/install_linux$//'`
CURRENT_PATH_ORIGNAL="$PWD"
#Global configure file: default is '/etc/ztemt_datacard_config'
GLOBAL_CONFIG_PATH="/etc/ztemt_datacard_config"
#Dest temp direcory for copying install programs: default is '/tmp/ztemt_datacard'
TMP_DIR_PATH="/tmp/ztemt_datacard"
#Main install program files path
SYSCONFIG_NAME="sysconfig.dat"
SYSCONFIG_ISO_PATH="Linux/${SYSCONFIG_NAME}"
BINFILE_ISO_PATH="Linux/${ZTEMTAPP_NAME}.bin"
INSTALLFILE_ISO_PATH="Linux/${INSTALL_FILENAME}"
ZIPFILE_ISO_PATH="Linux/7zr"
#Real install program path
INSTALL_PATH="$TMP_DIR_PATH/Linux"
INSTALL_FILE_PATH="$TMP_DIR_PATH/Linux/$INSTALL_FILENAME"
#Data card log file: defaul is '/tmp/ztemt_datacard_logfile.txt'
LOGFILE_PATH="/tmp/ztemt_datacard_logfile.txt"
check_iso()
{
echo "... Beginning Verify CD ... " | tee -a $LOGFILE_PATH
if [ ! -f "${CURRENT_PATH}/${SYSCONFIG_ISO_PATH}" ] ; then
echo "ERROR: The '${CURRENT_PATH}/${SYSCONFIG_ISO_PATH}' file don't exist! " | tee -a $LOGFILE_PATH
echo_exit
fi
if [ ! -f "${CURRENT_PATH}/${BINFILE_ISO_PATH}" ] ; then
echo "ERROR: The '${CURRENT_PATH}/${BINFILE_ISO_PATH}' file don't exist! " | tee -a $LOGFILE_PATH
echo_exit
fi
if [ -d "$TMP_DIR_PATH" ] ; then
rm -rf $TMP_DIR_PATH
fi
mkdir $TMP_DIR_PATH
if [ ! -d "$TMP_DIR_PATH" ] ; then
echo "ERROR: Can't create the temp work path : $TMP_DIR_PATH " | tee -a $LOGFILE_PATH
echo_exit
fi
echo "... Verify CD Succeed! " | tee -a $LOGFILE_PATH
}
copy_iso()
{
echo "... Beginning Copy Install Package Files ... " | tee -a $LOGFILE_PATH
echo " ... will take a long time, waiting 5 seconds, please" | tee -a $LOGFILE_PATH
cp -Rpd "${CURRENT_PATH}/Linux" $TMP_DIR_PATH
chmod -R a+r+x $TMP_DIR_PATH
if [ -f "${TMP_DIR_PATH}/${SYSCONFIG_ISO_PATH}" ] ; then
echo "... Copy Install Package Files Succeed! " | tee -a $LOGFILE_PATH
else
echo "ERROR: Copy Install Package Files! " | tee -a $LOGFILE_PATH
echo_exit
fi
}
verify_version()
{
echo "Beginning Verify the Version of '$ZTEMTAPP_NAME' ... " | tee -a $LOGFILE_PATH
#Version compare result
VERSION_COMP_RESULT="-1"
#Installing version and Installed version
TARGET_VERSION=""
TARGET_MAJOR=""
TARGET_MINOR=""
TARGET_BUILD=""
CURRENT_VERSION=""
CURRENT_MAJOR=""
CURRENT_MINOR=""
CURRENT_BUILD=""
TARGET_VERSION=`grep version $TMP_DIR_PATH/$SYSCONFIG_ISO_PATH | head -n1 | cut -d = -f2 | tr -d "\015"`
TARGET_MAJOR=`echo $TARGET_VERSION | cut -d. -f1`
TARGET_MINOR=`echo $TARGET_VERSION | cut -d. -f2`
TARGET_BUILD=`echo $TARGET_VERSION | cut -d. -f3`
CURRENT_VERSION=`grep version $GLOBAL_CONFIG_PATH | head -n1 | cut -d = -f2 | tr -d "\015"`
CURRENT_MAJOR=`echo $CURRENT_VERSION | cut -d. -f1`
CURRENT_MINOR=`echo $CURRENT_VERSION | cut -d. -f2`
CURRENT_BUILD=`echo $CURRENT_VERSION | cut -d. -f3`
echo "... Installing Version is : ${TARGET_VERSION}" | tee -a $LOGFILE_PATH
echo "... Installed Version is : ${CURRENT_VERSION}" | tee -a $LOGFILE_PATH
if [ -n "${CURRENT_VERSION}" ] ; then
#Version Compare
if [ "$TARGET_MAJOR" -gt "$CURRENT_MAJOR" ]; then
VERSION_COMP_RESULT="1"
elif [ "$TARGET_MAJOR" -eq "$CURRENT_MAJOR" ]; then
if [ "$TARGET_MINOR" -gt "$CURRENT_MINOR" ]; then
VERSION_COMP_RESULT="1"
elif [ "$TARGET_MINOR" -eq "$CURRENT_MINOR" ]; then
if [ "$TARGET_BUILD" -gt "$CURRENT_BUILD" ]; then
VERSION_COMP_RESULT="1"
elif [ "$TARGET_BUILD" -eq "$CURRENT_BUILD" ]; then
VERSION_COMP_RESULT="0"
fi
fi
fi
else
#When no version info in global config file, to force install
VERSION_COMP_RESULT="100"
fi
}
install_init()
{
OLD_PKG_VERSION=""
echo_platform
echo "... Checking 'App' process " | tee -a $LOGFILE_PATH
if [ -n "$($(which pidof) App)" ]; then
echo "... Warning: 'App' is running, are you sure to uninstall [y/n] ? "
read varsel
if [ "$varsel" = "y" ] || [ "$varsel" = "Y" ] ; then
sudo killall -9 App
echo " ... Killed 'App' process! "
else
echo "You canceled uninstall, exit! "
exit
fi
fi
echo "... Checking old installation " | tee -a $LOGFILE_PATH
if [ "$PLATFORM" = "Ubuntu" ] ; then
OLD_PKG_VERSION=`dpkg -s CrossPlatformUI 2>&1 |grep Version: |cut -d: -f2`
#Version: 2.2.3
if [ -n "$OLD_PKG_VERSION" ]; then
echo " ... Found old installation, version is '$OLD_PKG_VERSION' " | tee -a $LOGFILE_PATH
echo " ... Are you sure to uninstall [y/n] ? " | tee -a $LOGFILE_PATH
read varsel
if [ "$varsel" = "y" ] || [ "$varsel" = "Y" ] ; then
sudo dpkg -P CrossPlatformUI > /dev/null
fi
fi
else
OLD_PKG_VERSION=`rpm -q CrossPlatformUI | cut -de -f1`
#CrossPlatformUI-V2.2-3.i586; package *** is not install
if [ "$OLD_PKG_VERSION" != "packag" ]; then
OLD_PKG_VERSION=`rpm -q CrossPlatformUI | cut -d- -f2 | sed 's/[ ]*//'`
echo " ... Found old installation, version is '$OLD_PKG_VERSION' " | tee -a $LOGFILE_PATH
echo " ... Are you sure to uninstall [y/n] ? " | tee -a $LOGFILE_PATH
read varsel
if [ "$varsel" = "y" ] || [ "$varsel" = "Y" ] ; then
sudo rpm -e CrossPlatformUI > /dev/null
fi
fi
fi
}
install_datacard()
{
echo "Beginning install ... " | tee -a $LOGFILE_PATH
install_init
echo "... Installing ... " | tee -a $LOGFILE_PATH
cd ${INSTALL_PATH}
./$INSTALL_FILENAME
echo "... Setting Global Configure File: '$GLOBAL_CONFIG_PATH'" >> $LOGFILE_PATH
cp $TMP_DIR_PATH/$SYSCONFIG_ISO_PATH $GLOBAL_CONFIG_PATH
echo "path=/usr/local/bin/$ZTEMTAPP_NAME" >> $GLOBAL_CONFIG_PATH
echo "exec=/usr/local/bin/$ZTEMTAPP_NAME/bin/App" >> $GLOBAL_CONFIG_PATH
echo "uninstall=/usr/local/bin/$ZTEMTAPP_NAME/$UNINSTALL_FILENAME" >> $GLOBAL_CONFIG_PATH
cat $GLOBAL_CONFIG_PATH >> $LOGFILE_PATH
cd "$CURRENT_PATH"
echo "... Removing Temporary Files ... " >> $LOGFILE_PATH
rm -rf $TMP_DIR_PATH
echo "... Current Path is : '$PWD' " >> $LOGFILE_PATH
echo "Install finished! " | tee -a $LOGFILE_PATH
}
#Writting log file, for debugging
echo "-------------------- Installing --------------------" >> $LOGFILE_PATH
date >> $LOGFILE_PATH
clear
echo_rootright
#Resolevd fedora 9 question: cann't find command 'pidof'
PATH=$PATH:/sbin
cd "$CURRENT_PATH"
CURRENT_PATH=$PWD
echo "Current Path is : '$PWD' " | tee -a $LOGFILE_PATH
check_iso
copy_iso
if [ -e "$GLOBAL_CONFIG_PATH" ] ; then
ZTEMTAPP_EXEC_PATH=`grep exec "${GLOBAL_CONFIG_PATH}" | awk -F '=' '{print $2}'`
ZTEMTAPP_UNINSTALL_PATH=`grep uninstall "${GLOBAL_CONFIG_PATH}" | awk -F '=' '{print $2}'`
if [ -f "$ZTEMTAPP_EXEC_PATH" ] ; then
echo "... '$ZTEMTAPP_NAME' has installed ! " | tee -a $LOGFILE_PATH
verify_version
if [ "$VERSION_COMP_RESULT" -gt 0 ] ; then
echo "... New Version, Installing ..." | tee -a $LOGFILE_PATH
install_datacard
elif [ "$VERSION_COMP_RESULT" -eq 0 ] ; then
echo "... WARNING: the same version, Do you want to reinstall [y/n] ? " | tee -a $LOGFILE_PATH
read varsel
if [ "$varsel" = "y" ] || [ "$varsel" = "Y" ] ; then
echo "... Uninstall previous verison " | tee -a $LOGFILE_PATH
if [ -f "${ZTEMTAPP_UNINSTALL_PATH}" ] ; then
. "${ZTEMTAPP_UNINSTALL_PATH}"
fi
install_datacard
else
echo "You canceled install, exit! " | tee -a $LOGFILE_PATH
echo ""
exit
fi
else
echo "... WARNING: old version! Are you sure to install [y/n] ? " | tee -a $LOGFILE_PATH
read varsel
if [ "$varsel" = "y" ] || [ "$varsel" = "Y" ] ; then
echo "... Uninstall previous verison " | tee -a $LOGFILE_PATH
if [ -f "${ZTEMTAPP_UNINSTALL_PATH}" ] ; then
. "${ZTEMTAPP_UNINSTALL_PATH}"
fi
install_datacard
else
echo "You canceled install, exit! " | tee -a $LOGFILE_PATH
echo ""
exit
fi
fi
else
echo "... Warning: previous version uninstall not finished, reforce to install " | tee -a $LOGFILE_PATH
install_datacard
fi
else
echo ""
echo "... '$ZTEMTAPP_NAME' previous version not found. and install now " | tee -a $LOGFILE_PATH
install_datacard
fi
exit
Так-как я пока плохо разбираюсь в данной системе, прошу Вас подсказать мне правильные действия для установки модема.