usb_key_func.sh tartalma a Medion Life P89626 esetén
Exe_USB_KEY()
{
# Check model name
model_id=`cat /zyxel/mnt/info/modelid`
if [ "${model_id}" == "A403" ]; then
export MODEL_NAME="STG100"
elif [ "${model_id}" == "A803" ]; then
export MODEL_NAME="STG211"
elif [ "${model_id}" == "AB03" ]; then
export MODEL_NAME="STG212"
fi
# Scan USB disk for HW test.
any_usb=`ls /sys/block/ | grep sd`
echo "${any_usb}"
if [ -n "${any_usb}" ]; then
/bin/mkdir /mnt/parnerkey
for usb in ${any_usb}
do
echo "checking ${usb}"
#Get the number of question marks
qmark_num=`fdisk -l /dev/${usb} | grep "^"/dev/${usb} | grep -c "?"`
partition_num=`fdisk -l /dev/${usb} | grep "^"/dev/${usb}`
if [ "${qmark_num}" == "4" ] || [ "${partition_num}" == "" ]; then
mnt_point=/dev/${usb}
echo "Trying to mount ${mnt_point}"
mount -o iocharset=utf8,shortname=mixed,ro ${mnt_point} /mnt/parnerkey
else
mnt_point=`fdisk -l /dev/${usb} | grep "^"/dev/${usb} | awk '{print $1}' | sed -n '1p'`
echo "Trying to mount ${mnt_point}"
mount -o iocharset=utf8,shortname=mixed,ro ${mnt_point} /mnt/parnerkey
fi
mount_SUC=`cat /proc/mounts | grep /mnt/parnerkey`
if [ "${mount_SUC}" != "" ]; then
#Currently, we don't need it.
# if [ "$1" == "FW_UPGRADE" ]; then
# ls -la /mnt/parnerkey | grep "${MODEL_NAME}_fw"
# FW=$?
# ls -al /mnt/parnerkey | grep "${MODEL_NAME}_pwr_func_check"
# PWR=$?
# if [ $FW != 0 ] && [ $PWR != 0 ] ; then
# umount /mnt/parnerkey
# fi
# fi
/sbin/check_key /mnt/parnerkey/${MODEL_NAME}_check_file
if [ $? == 0 ]; then
#/mnt/parnerkey/usb_key_func.sh
script_path=`cat /mnt/parnerkey/${MODEL_NAME}_check_file | sed -n '1p'`
${script_path}
${script_path}
if [ $? == 0 ]; then
exit 0
fi
fi
umount /mnt/parnerkey
else
echo "Fail to mount ${mnt_point}"
fi
done
rmdir /mnt/parnerkey
fi
}
"A mosoly olyan, mint egy ablakban felgyúló fény, amellyel a lélek jelzi, hogy a szív otthon van."