alterator-net-pppoe-0.4.4/000075500000000000000000000000001076327452600154335ustar00rootroot00000000000000alterator-net-pppoe-0.4.4/Makefile000064400000000000000000000006611076327452600170760ustar00rootroot00000000000000NAME=net-pppoe DESCRIPTION="PPPOE connections" INSTALL=/usr/bin/install all: clean: clean-po install: install-backend install-ui install-po install-html include /usr/share/alterator/build/po.mak include /usr/share/alterator/build/ui2.mak include /usr/share/alterator/build/backend.mak include /usr/share/alterator/build/fbi.mak include /usr/share/alterator/build/html-messages.mak HTML_PO_TEMPLATE=ui/net-pppoe/html-messages.scm alterator-net-pppoe-0.4.4/applications/000075500000000000000000000000001076327452600201215ustar00rootroot00000000000000alterator-net-pppoe-0.4.4/applications/net-pppoe.desktop000064400000000000000000000004331076327452600234230ustar00rootroot00000000000000[Desktop Entry] Encoding=UTF-8 Type=Application Categories=X-Alterator-Network Icon=net-pppoe Terminal=false Name=PPPoE connections Name[ru_RU]=PPPoE-соединения Name[uk_UA]=PPPoE-з'єднання X-Alterator-URI=/net-pppoe X-Alterator-Help=net-pppoe X-Alterator-Weight=20 alterator-net-pppoe-0.4.4/backend3/000075500000000000000000000000001076327452600171055ustar00rootroot00000000000000alterator-net-pppoe-0.4.4/backend3/net-pppoe000075500000000000000000000113261076327452600207450ustar00rootroot00000000000000#!/bin/sh -ef PATH=/usr/lib/alterator-net-common:$PATH ################### shell file helpers shell_add_or_subst() { local name="$1" && shift local value="$1" && shift local file="$1" && shift [ -f "$file" ] || touch "$file" if grep -qs "^$name" "$file"; then /bin/sed -r -i "s,^$name.*,$name$value," -- "$file" return 0 fi printf %s\\n "$name$value" >> "$file" } ################### interface modificators first_available() { local path="/etc/net/ifaces/ppp" local i=0 while true; do [ -d "$path$i" ] || { echo "ppp$i" && break; } i=$(($i + 1)) done } list_iface() { echo '(' for i in `find /etc/net/ifaces -type d -name 'ppp*'` do [ -f $i/options ] && grep -qs 'PPPTYPE=pppoe' $i/options && echo "(\"`basename $i`\")" done echo ')' } list_eth() { echo '(' iflist| while read name mac;do printf '("%s")' "$name" done echo ')' } read_iface() { local name="/etc/net/ifaces/$1" local MPPE="#f" # mppe is off by default with pppd grep -q '^require-mppe' "$name/pppoptions" && MPPE="#t" echo '(' local info= ifcheckup "$1" && info="`_ "connection established"`" || info="`_ "connection failed"`" printf 'info "%s"' "$info" printf 'iface "%s"' "$(grep '^HOST=' "$name/options"|sed -r 's,HOST=,,')" printf 'login "%s"' "$(grep '^user' "$name/pppoptions"|sed -r 's,user[[:space:]]*,,')" printf 'mppe %s' "$MPPE" echo ')' } write_iface() { [ "$1" = "/" ] && return local name="/etc/net/ifaces/$1" local prev_login="$(grep '^user' "$name/pppoptions"|sed -r 's,user[[:space:]]*,,')" [ -d "$name" ] || mkdir "$name" [ -f "$name/options" ] || touch "$name/options" [ -f "$name/pppoptions" ] || touch "$name/pppoptions" [ -n "$in_iface" ] && shell_add_or_subst "HOST=" "$in_iface" "$name/options" if [ -n "$in_login" ] ;then sed -r "s,^user[[:space:]].*,user $in_login," -i "$name/pppoptions" prev_login="$in_login" fi if [ -n "$in_password" ]; then in_password=$(echo "$in_password"|sed -e 's/["]/\\\\&/g') chmod o-rw "$name/pppoptions" sed -r "s,^password[[:space:]].*,password $in_password," -i "$name/pppoptions" fi set_mppe ifdown "$1" && ifup "$1" } new_iface() { local name="/etc/net/ifaces/$1" in_password=$(echo "$in_password"|sed -e 's/["]/\\\\&/g') [ -d "$name" ] || mkdir "$name" [ -f "$name/options" ] || touch "$name/options" [ -f "$name/pppoptions" ] || touch "$name/pppoptions" # deny others reading the password chmod o-rw "$name/pppoptions" shell_add_or_subst "ONBOOT=" "yes" "$name/options" shell_add_or_subst "PPPTYPE=" "pppoe" "$name/options" shell_add_or_subst "HOST=" "$in_iface" "$name/options" shell_add_or_subst "PPPPERSIST=" "on" "$name/options" shell_add_or_subst "PPPMAXFAIL=" "0" "$name/options" shell_add_or_subst "user " "$in_login" "$name/pppoptions" shell_add_or_subst "password " "$in_password" "$name/pppoptions" shell_add_or_subst "defaultroute" "" "$name/pppoptions" shell_add_or_subst "mtu " "1476" "$name/pppoptions" set_mppe ifup "$1" return 0 } delete_iface() { [ "$1" = "/" ] && return local name="/etc/net/ifaces/$1" local prev_login="$(grep '^user' "$name/pppoptions"|sed -r 's,user[[:space:]]*,,')" ifdown "$1" rm -rf "$name" } set_mppe() { if [ -n "$in_mppe" ]; then if [ "$in_mppe" = "#t" ]; then MPPE_ADD="require-mppe" MPPE_DEL="nomppe" else MPPE_ADD="nomppe" MPPE_DEL="require-mppe" fi sed "/^$MPPE_ADD/d" -i "$name/pppoptions" ||: if grep -q "^$MPPE_DEL" "$name/pppoptions"; then sed "s,^$MPPE_DEL,$MPPE_ADD," -i "$name/pppoptions" ||: else echo "$MPPE_ADD" >> "$name/pppoptions" fi fi } _() { LANG=${in_language%%;*}.utf8 gettext "alterator-net-pppoe" "$1" } . /usr/share/alterator/build/backend3.sh on_message() { case "$in_action" in ##information constraints) local required="$([ "$in_orig_action" = "new" ] && echo "#t" || echo "#f")" echo '(' printf 'iface (required #t label "%s")' \ "`_ "Interface"`" printf 'login (required #t label "%s")' \ "`_ "Login"`" printf 'name (required %s match ("^ppp[0-9]+$" "%s" ) default "%s" label "%s")' \ "$required" \ "`_ "should be ppp[number]"`" \ "$(first_available)" \ "`_ "Connection"`" printf 'password (required %s label "%s")' \ "$required" \ "`_ "Password"`" echo ')' ;; ##actions list) if [ "$in__objects" = "/" ];then list_iface else list_eth fi ;; read) if [ "$in__objects" = "/" ];then echo '()' else read_iface "$in__objects" fi ;; write) write_iface "$in__objects" echo '()' ;; new) if new_iface "$in_name"; then echo '()' else printf '(error "%s")' "`_ "same login name already in use"`" fi ;; delete) delete_iface "$in__objects" echo '()' ;; *) echo '#f' ;; esac } message_loop alterator-net-pppoe-0.4.4/backend3/template-net-pppoe000075500000000000000000000005601076327452600225540ustar00rootroot00000000000000#!/bin/sh #turn off auto expansion set -f . /usr/share/alterator/build/backend3.sh on_message() { case "$in_action" in #information for renderer template) if [ "$in__objects" = "/" ];then echo '(' echo 'template "card-index" ' echo 'url "net-pppoe.html"' echo ')' else echo '#f' fi ;; *) echo '#f' esac } message_loop alterator-net-pppoe-0.4.4/help/000075500000000000000000000000001076327452600163635ustar00rootroot00000000000000alterator-net-pppoe-0.4.4/help/ru_RU/000075500000000000000000000000001076327452600174175ustar00rootroot00000000000000alterator-net-pppoe-0.4.4/help/ru_RU/net-pppoe.html000064400000000000000000000021031076327452600222100ustar00rootroot00000000000000 Help - ALT Linux Console

PPPoE-соединения

PPPoE (Point-to-point protocol over Ethernet) — протокол для организации прямого соединения между двумя машинами в сети. В основном используется xDSL-сетями. Для создания нового соединения необходимо указать Ethernet-интерфейс, через который будет производиться соединение, а также системное имя и пароль пользователя на PPPoE-сервере.

Имена для PPPoE-соединений принято назначать в формате ppp[номер].

alterator-net-pppoe-0.4.4/help/uk_UA/000075500000000000000000000000001076327452600173675ustar00rootroot00000000000000alterator-net-pppoe-0.4.4/help/uk_UA/net-pppoe.html000064400000000000000000000020761076327452600221710ustar00rootroot00000000000000 Help - ALT Linux Console

PPPoE-з'єднання

PPPoE (Point-to-point protocol over Ethernet) — протокол для організації прямого з'єднання між двома комп'ютерами в мережі. В основному використовується xDSL-мережами. Для створення нового з'єднання необхідно вказати Ethernet-інтерфейс, через який буде виконуватися з'єднання, а також системне ім'я та пароль користувача на PPPoE-сервері.

Імена для PPPoE-з'єднань прийнято назначати у форматі ppp[номер].

alterator-net-pppoe-0.4.4/html/000075500000000000000000000000001076327452600163775ustar00rootroot00000000000000alterator-net-pppoe-0.4.4/html/fbi/000075500000000000000000000000001076327452600171375ustar00rootroot00000000000000alterator-net-pppoe-0.4.4/html/fbi/net-pppoe.html000064400000000000000000000035321076327452600217370ustar00rootroot00000000000000 PPPoE connections - ALT Linux Console