V380E2_C þþþþþþþ]·Š ö ÌÌÌÌÌÌÌÌ ÌÌÌÌÍF[€ôû ”V `À9]·Š ”é2°ý dV ôû ˜È3˜È3˜È3 `À9¸ƒ4exshell.sh ÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÉ ÌÌÌÌ#!/bin/sh
jffs_dir=/mnt/mtd
############################
# -- rtsp --
has_rtsp=1
has_rtsp_exist=`sed -n '/has_rtsp=/p' /mnt/mtd/authority.ini | wc -l`
if [ $has_rtsp_exist -eq 0 ]
then
sh -c "sed -i '/\[AUTHORITY\]/a\\has_rtsp=$has_rtsp' /mnt/mtd/authority.ini"
else
sh -c "sed -i 's/^has_rtsp=.*/has_rtsp=$has_rtsp/' /mnt/mtd/authority.ini"
fi
##############################
# -- old version --
rm /tmp/hu_files_tmpdir/exshell_bfu.sh -f
exshell_bfu.sh ÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌ‘ ÌÌÌÌ#!/bin/sh
jffs_dir=/mnt/mtd
############################
# -- rtsp --
has_rtsp=1
has_rtsp_exist=`sed -n '/has_rtsp=/p' /mnt/mtd/authority.ini | wc -l`
if [ $has_rtsp_exist -eq 0 ]
then
sh -c "sed -i '/\[AUTHORITY\]/a\\has_rtsp=$has_rtsp' /mnt/mtd/authority.ini"
else
sh -c "sed -i 's/^has_rtsp=.*/has_rtsp=$has_rtsp/' /mnt/mtd/authority.ini"
fi
############################
#
telnetd &
patchrule.sh h ÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌ\ ÌÌÌÌ#!/bin/sh
exit 0
VERFILE=/mnt/mtd/version.ini
VERFILE_TMP=/tmp/version.ini
do_checkandcopy()
{
tmpmd5=`md5sum $1`
md5from=${tmpmd5% *}
tmpmd5=`md5sum $2`
md5to=${tmpmd5% *}
if [ "$md5to" = "" ]
then
md5to=0
fi
if [ "$md5from" = "" ]
then
md5from=md5to
fi
if [ "$md5from" != "$md5to" ]
then
echo "copy $1"
cp $1 $2 -f
fi
}
do_setversion()
{
if [ -f "$VERFILE" ]
then
cp $VERFILE $VERFILE_TMP -f
sed -i 's/^name=App39.*/name=App39_PTZ_V1.3.1.4/' $VERFILE_TMP
sed -i '/name=App39_PTZ_V1.3.1.4/{ n; d;}' $VERFILE_TMP
sed -i '/name=App39_PTZ_V1.3.1.4/a\\date=20150202' $VERFILE_TMP
fi
}
#
#main
#
#preset version
rm /mnt/mtd/DDNSClient.ini -f
do_setversion
do_checkandcopy /tmp/osdparam.ini /mnt/mtd/osdparam.ini
do_checkandcopy /tmp/libmobile.so /mnt/mtd/libmobile.so
do_checkandcopy /tmp/recorder /mnt/mtd/recorder
do_checkandcopy /tmp/akmodeselection /mnt/mtd/akmodeselection
do_checkandcopy /tmp/as9nvserver /mnt/mtd/as9nvserver
do_checkandcopy /tmp/as9updatednsip /mnt/mtd/as9updatednsip
do_checkandcopy /tmp/as9ipcwatchdog /mnt/mtd/as9ipcwatchdog
do_checkandcopy /tmp/libvsencodesend.so /mnt/mtd/libvsencodesend.so
do_checkandcopy /tmp/authority.ini /mnt/mtd/authority.ini
do_checkandcopy /tmp/exalarm.ini /mnt/mtd/exalarm.ini
if [ -f "$VERFILE_TMP" ]
then
cp $VERFILE_TMP $VERFILE -f
fi
echo "=== patch to V1.3.1.4 finished ==="
ولی وقتی باز میکنه احتمالا دوباره checksum میگیره و میبینه با اونی که توی سر فایل هست فرق میکنه پس فایل اسکریپت رو قبول نمیکنه.
echo ok >> $0
بعد رم رو باز کن و ببین به آخر همون فایل اسکریپت آیا ok اضافه شده یا نه ؟ اگر اضافه نشده بود یعنی فایل رو توی یک جای دیگه ذخیره می کنه. اگر خطا داد به احتمال زیاد باید خطای دسترسی (نوشتن) رخ داده باشه. که می تونی خودت یک پوشه با دسترسی ۷۷۷ درست کن و اونجا بریز.
می تونی دوباره ssh سرور رو بدون کتابخانه های اشتراکی (shread library ) کامپایل کن و توی همون پوشه بزار و از توی اسکریپت اجراش کن.
.یعنی میشه ssh رو روی یه سیستم دیگه کامپاایل کرد بعد بصورت Portable رو سیستم دیگه اجرا کرد؟ببین باید اول بفهمی که معماری cpu اون دوربین چیه ؟ بعد متناسب با اون باید کامپیایل کنی مثلا روی ماشین مجازی یا روش های دیگه (distcc هم فکر کنم همچین قابلیتی داشت - خیلی وقت پیش برای راسپری تست کردم . نتیجه اش رو دقیق یادم نیست-درکل ماشین مجازی خیلی مطمئنتره distcc ممکنه بدون خطا فایل خراب تولید کنه.چون اصلا برای اینکار ساخته نشده).
اگه روی این سیستم پورت ssh رو بسته باشن هم ssh جدید اجرا میشه؟
تو اینترنت نسخه ای از ssh آماده پیدا میشه؟
با این روش مشکلی که هست اینه که من نمیتونم توی فایل اسکریبتم به بوشه داخل رم اشاره کنم.چون فایل اسکریبت جای دیگه کبی میشه و نمیدونه رم آدرسش چیه.درسته؟
PORT STATE SERVICE
554/tcp open rtsp
5040/tcp open unknown
5050/tcp open mmcc
5051/tcp open ida-agent
7050/tcp open unknown
8800/tcp open sunwebadmin
8899/tcp open ospf-lite
------------------------
Device type: general purpose
Running: Linux 2.6.X|3.X
OS CPE: cpe:/o:linux:linux_kernel:2.6 cpe:/o:linux:linux_kernel:3
OS details: Linux 2.6.32 - 3.10
exec 3<>/dev/tcp/hostname/port
echo "request" 1>&3
response="$(cat <&3)"
https://unix.stackexchange.com/questions/336876/simple-shell-script-to-send-socket-messagetelnetd -l /bin/sh &