-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add using hotplug, init.d and procd OpenWrt system. Do not more need … #2
base: master
Are you sure you want to change the base?
Conversation
…cron and usbreset, using reconnect! And also, autoupdate ban list on reconnect!
echo -e "login\npassword\nreboot" | nc 192.168.8.1 23 Так пробовал? |
|
||
/etc/init.d/yotaban enabled && { | ||
[ -f /tmp/yotaban ] && { | ||
# remove old records |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Если список изменился, старые записи таким методом не удалятся.
Чтобы избежать этой проблемы в TTLMaster для Android я создавал отдельную новую цепочку со всеми правилами дропа. И когда нужно, польностью её обнулял.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Тем не менее, у меня это работает. Но у меня удален из прошивки фарйволл, потому более ничего iptables не трогает.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ну да, работать-то будет, проблема не в этом. Проблема в том, что мы удалим одну запись из списка, обновим его и перезапустим этот скрипт -- удаленная запись останется в правилах.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Попробовал ваш способ для записи в telnet - нет, не работает
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Может быть так?
(echo root; echo root; echo reboot) | while read s; do echo "$s"; sleep 1; done | nc 192.168.1.1 23
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Работает, несколько упростил:
echo reboot | busybox nc -w 1 -i 1 192.168.8.1 23
Но в OpenWrt как всегда по дефолту не добавлены эти ключи, пришлось городить костыль:
(echo reboot; sleep 1) | nc 192.168.8.1 23 & (sleep 1; kill `pidof $(ps | grep 'nc 192.168.8.1 23' | grep -v 'grep')`)
Кстати, я сделал пакеты и конфиг написал, сейчас дополнил телнетом.
content=$(wget captive.apple.com -q -O -) | ||
if [ `echo $content | grep -c "tethering.svg" ` -gt 0 ] | ||
then | ||
usbreset "HUAWEI Mobile" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Может быть использовать конфиг-файл для определения метода перезагрузки? Тогда можно было бы скрипты полностью уже собранным opkg-пакетом дистрибьютить.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я пока конфиг-файлы не писал. Посмотрю, идея хорошая.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ОК. Помогу по мере возможности, спрашивай, если что: баш знаю хорошо, но к openwrt у меня сейчас доступа нет.
adbport="`uci -q get yota.@yotareboot[0].adbport`" | ||
ttydevice="`uci -q get yota.@yotareboot[0].ttydevice`" | ||
usbreset="`uci -q get yota.@yotareboot[0].usbreset`" | ||
method="`uci -q get yota.@reboot[0].method`" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Какая-то задница. Так лучше не делать.
method=$(uci -q get yota.@reboot[0].method)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Почему? Они же индентичны...
Бинарники, да еще и зазипованные, в гите -- bad practice, тем более, со скриптами, которые лежат в репе :( По-хорошему -- все это нужно в github-релизы выкладывать. @kolyanok дадим ему доступ к репе? В целом все выглядит хорошо В идеале -- могу билд-ферму поднять, чтобы после каждого коммита собирало скрипты в zip и openwrt-пакеты |
А, чорт, уже приглашен. Тогда поднимаю билдферму и мержу |
@ilya-fedin подскажи только, как собственно собирать пакеты |
@derlaft нужно брать OpenWrt Buildroot (который у меня уже есть, т. к. я собираю прошивки), добавлять папку со скриптами в package (в соответствующую подпапку, в нашем случае package/network/utils), для сборки - |
…cron and usbreset, using reconnect! And also, autoupdate ban list on reconnect!