??????? ??? ????????? Globax ??? Linux ?? ??????????? ??????

 
Начать новую тему   Ответить на тему    Список форумов ????? Globax.biz -> ?????????, ?????????
Предыдущая тема :: Следующая тема  
Автор Сообщение
oldboy



Зарегистрирован: 24.02.2013
Сообщения: 12

СообщениеДобавлено: Ср Сен 11, 2013 10:20 am    Заголовок сообщения: ??????? ??? ????????? Globax ??? Linux ?? ??????????? ?????? Ответить с цитатой

??????-????????

Код:
#!/bin/sh

PWD_HASH=`echo -n "$1$(echo -n $2|md5sum|sed -r 's/([0-9a-f]*).*/\1/')"|md5sum|sed -r 's/([0-9a-f]*).*/\1/'`

wget -o/dev/null http://api.radugainternet.ru/globax?login=$1\&password=$PWD_HASH -O /tmp/rdgsettings

SRV_IP=`cat /tmp/rdgsettings |sed 'N;s/.*\?access_point=\"\([0-9.]\+\)\".*/\1/'`
ID=`cat /tmp/rdgsettings |sed 'N;s/.*\? id=\"\([0-9]*\)\".*/\1/'`
TUN_IP=10.$(( $ID / 254 / 256 + 32 )).$(( $ID / 254 % 256 )).$(( $ID % 254 + 1 ))

(
cat <<EOF
[server]
        port = 2041
        log = /tmp/gx.log
        traffic = 300
        debug = 1
[remote]
        name = globax
        server = $SRV_IP:32000
        login = $1
        passwd = $PWD_HASH
        mtu = 500
        mru = 1400
        speed_in = 1000000
        speed_out = 2000:8000
[local]
        remote = globax
        port = 127.0.0.1:3128
        service_int = 0
[local]
        remote = globax
        transparent
        port=127.0.0.1:3000
[local]
        remote = globax
        tunnel = tun0:$TUN_IP

EOF
) > /tmp/globax.conf

StarBlazer
Код:
#!/bin/sh

wget --no-check-certificate -o/dev/null https://217.150.7.21/starblazer/index.php?login=$1\&password=$2 -O /tmp/sbsettings

GX_LOGIN=`cat /tmp/sbsettings | grep  "<login>" | sed "{s/<[^<]*>//g}"`
GX_PASSWORD=`cat /tmp/sbsettings | grep  "<pass>" | sed "{s/<[^<]*>//g}"`
S_PORT=`cat /tmp/sbsettings | grep  "<localport>" | sed "{s/<[^<]*>//g}"`
R_PORT=`cat /tmp/sbsettings | grep  "<serverport>" | sed "{s/<[^<]*>//g}"`
SPEED_IN=`cat /tmp/sbsettings | grep  "<speed_in>" | sed "{s/<[^<]*>//g}"`
TUN_IP=`cat /tmp/sbsettings | grep  "<tap_ip>" | sed "{s/<[^<]*>//g}"`

(
cat <<EOF
[server]
        port = $S_PORT
        log = /tmp/gx.log
        traffic = 300
        debug = 1
[remote]
        name = globax
        server = 217.150.7.21:${R_PORT}
        login = $GX_LOGIN
        passwd = $GX_PASSWORD
        mtu = 500
        mru = 1400
        speed_in = $SPEED_IN
        speed_out = 2000:8000
[local]
        remote = globax
        port = 127.0.0.1:3128
        service_int = 0
[local]
        remote = globax
        transparent
        port=127.0.0.1:3000
[local]
        remote = globax
        tunnel = tun0:$TUN_IP
EOF
) > /tmp/globax.conf

?????????????: "./script_name login password", ??? login ? password - ????? ? ?????? ?? ??????? ????????.
? ?????????? ?????? ??????? ????????? ??????? ??? ????????????? ???? ???????????? /tmp/globax.conf
? ?????? ?????? ???????????? Globax ????????? HTTP-?????? ?? 3128 ?????, ?????????? ?????? ?? 3000 ????? ? ????????? ??????????? ??????? tun0
Вернуться к началу
Посмотреть профиль Отправить личное сообщение
Показать сообщения:   
Начать новую тему   Ответить на тему    Список форумов ????? Globax.biz -> ?????????, ????????? Часовой пояс: GMT + 2
Страница 1 из 1

 
Перейти:  
Вы не можете начинать темы
Вы не можете отвечать на сообщения
Вы не можете редактировать свои сообщения
Вы не можете удалять свои сообщения
Вы не можете голосовать в опросах


Powered by phpBB © 2001, 2005 phpBB Group