#!/usr/bin/webif-page >/tmp/mac_sh . /usr/lib/webif/webif.sh validate <>|max=10|$FORM_submit EOF sel_mac=1 . /usr/lib/webif/advanced.sh config_load fon empty "$FORM_restore" || { FORM_submit=0 FORM_mac_addr="" } if empty "$FORM_submit"; then get_default mac_addr wan mac if [ -z $FORM_mac_addr ] then FORM_mac_addr=$(ifconfig eth0|grep HWaddr|sed -e "s/^.*HWaddr //" |sed -e "s/ //g") fi else if [ -z $FORM_mac_addr ]; then if [ -f /tmp/eth0_mac ]; then FORM_mac_addr=$(cat /tmp/eth0_mac) else FORM_mac_addr=$( ifconfig eth0|grep HWaddr|sed -e "s/^.*HWaddr //" |sed -e "s/ //g" ) fi fi FORM_mac_addr=`echo $FORM_mac_addr|tr '\-' ':'` validate <>|required|$FORM_mac_addr EOF equal "$?" 0 && { save_setting fon wan mac "$FORM_mac_addr" commit_settings SAVED=1 } fi header "MAC Cloning" if [ "$SAVED" = "1" ]; then echo "

EXECUTING CONFIGURATION" fi display_form <>: add_input_cell|mac_addr|$FORM_mac_addr|tableTextButton end_row end_table start_table|0|10|5 add_row add_button_cell|submit|@TR<>|tableTextButton add_label_cell add_label_cell add_button_cell|restore|@TR<>|tableTextButton end_row end_table help|mac EOF footer if [ "$SAVED" = "1" ]; then SAVED=0 display_form <