(пробелы после < вставлены, чтобы корректно отображался код)
#!/bin/bash
#
# SliTaz pppoe-starter
# ver 0.1
# (c) Onion, 20100722
status_check
{
if [ -f /var/run/pppoe.conf-pppoe.pid.pppoe ]
then
STATUS="ON"
else
STATUS="OFF"
fi
}
status_check
export MAIN_DIALOG='
< window title="pppoe-starter" icon-name="network-transmit-receive">
< vbox>
< text use-markup="true" width-chars="25">
< label>"< b>PPPoE-starter< /b>"< /label>
< /text>
< text wrap="true"use-markup="true">
< label>(c) Onion, ver 0.1< /label>
< /text>
< text use-markup="true">
< variable>TEXT_STATUS< /variable>
< label>"< b>'$STATUS'< /b>"< /label>
< action>status_check< /action>
< action>refresh:TEXT_STATUS< /action>
< /text>
< button>
< label>PPPoE start< /label>
< input file icon="gnome-netstatus-rx">< /input>
< action>pppoe-start< /action>
< action>status_check< /action>
< action>refresh:TEXT_STATUS< /action>
< /button>
< button>
< label>PPPoE stop< /label>
< input file icon="network-offline">< /input>
< action>pppoe-stop< /action>
< action>status_check< /action>
< action>refresh:TEXT_STATUS< /action>
< /button>
< /vbox>
< /window>
'
gtkdialog --center --program=MAIN_DIALOG
exit 0
status_check()Попробуй во всех местах проставить эти скобки.
status_check() {Вызов функции
тело функции
}
status_checkhttp://rus-linux.net/lib.php?name=MyLDP/consol/aliases.html
export BIN=$0
BIN check
check() {
...
}
case $1 in
check) check;;
esac
или
if [ "$1" = "check" ]
then
check
fi
#!/bin/bash
#
# SliTaz pppoe-starter
# ver 0.1.2
# (c) Onion, 20100809
export TIME=`date`
export FILE='/bin/pppoe-starter'
export STATUS="ERR"
status_check()
{
if [ -f /var/run/pppoe.conf-pppoe.pid.pppoe ]
then
export STATUS="ON"
else
export STATUS="OFF"
fi
echo $STATUS > /tmp/pppoe-starter
}
export CHECK=status_check
if [ "$1" = "check" ]
then
$CHECK
fi
if [ "$1" = "" ]
then
$CHECK
export STARTER_BOX='
< window title="pppoe-starter" icon-name="network-transmit-receive">
< vbox>
< text use-markup="true">
< label>"< b>PPPoE-starter< /b>"< /label>
< /text>
< text wrap="true"use-markup="true">
< label>(c) Onion, ver 0.1< /label>
< /text>
< text>
< variable>TEXT_STATUS< /variable>
< label>Status< /label>
< input>cat /tmp/pppoe-starter< /input>
< /text>
< button>
< label>PPPoE start< /label>
< input file icon="gnome-netstatus-rx">< /input>
< action>pppoe-start< /action>
< action>$FILE check< /action>
< action>refresh:TEXT_STATUS< /action>
< action>[ $LOG == true ] && echo "connected at" $TIME >> '/var/log/pppoe-starter'< /action>
< /button>
< button>
< label>PPPoE stop< /label>
< input file icon="network-offline">< /input>
< action>pppoe-stop< /action>
< action>$FILE check< /action>
< action>refresh:TEXT_STATUS< /action>
< action>[ $LOG == true ] && echo "disconnected at" $TIME >> '/var/log/pppoe-starter'< /action>
< /button>
< checkbox>
< label>save log to /var/log/pppoe-starter< /label>
< variable>LOG< /variable>
< default>true< /default>
< /checkbox>
< /vbox>
< /window>
'
gtkdialog --center --program=STARTER_BOX > /dev/null
fi
exit 0
[Desktop Entry]
Name=ADSL
Exec=subox pppoe-starter
Icon=/usr/share/icons/SliTaz/32x32/status/network-transmit-receive.png
It looks like you're new here. If you want to get involved, click one of these buttons!