code stringlengths 1 1.96M | language stringclasses 1
value |
|---|---|
#!/bin/sh /etc/rc.common
#
# identification of the device
#
START=90
start() {
. /lib/config/uci.sh
. /usr/lib/webif/functions.sh
uci_load "webif"
# initialize default webif theme
if [ ! -e /www/themes/active ]; then
config_get newtheme theme id
# if theme isn't present, then install it
! exists "/www/themes/$... | Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2008 x-wrt.org
START=49
config_cb() {
local cfg_type="$1"
local cfg_name="$2"
case "$cfg_type" in
crontab)
append CRONTABS_cfg "$cfg_name"
;;
esac
}
start () {
config_load crontabs
echo "# WARNING: this is an auto generated file, please use uci to set cron ent... | Shell |
#!/bin/sh /etc/rc.common
START=11
timezone_config() {
local cfg="$1"
local posixtz
local etctz="/etc/TZ"
config_get posixtz "$cfg" posixtz
if [ ! -h $etctz ]; then
ln -sf /tmp/TZ "$etctz"
fi
[ -n "$posixtz" ] && echo "$posixtz" > "$etctz" || echo "UTC+0" > "$etctz"
}
start() {
config_load timezone
conf... | Shell |
#!/bin/sh /etc/rc.common
# backup dmesg
#
START=99
dmesgbackup_config() {
local cfg="$1"
local enabled file gzip GZIP_CMD
local DEFAULT_enabled=0
local DEFAULT_file="/var/log/dmesg"
local DEFAULT_gzip=1
config_get_bool enabled "$cfg" enabled "$DEFAULT_enabled"
[ "$enabled" -eq 1 ] && {
config_get file "$cfg"... | Shell |
#!/bin/sh /etc/rc.common
START=90
start() {
. /lib/config/uci.sh
. /usr/lib/webif/functions.sh
uci_load "webif"
config_get enabled firewall log
if [ "$enabled" = "1" ]; then
iptables -A input_rule -j LOG --log-prefix "input_rule:DROP "
iptables -A forwarding_rule -j LOG --log-prefix "forwarding_rule:DROP "
i... | Shell |
#!/bin/sh
# Create default language list from translations.
# (c) 2008 Lubos Stanek - X-Wrt project
# Released under GPL license.
#
WEBIF_ROOT="$1"
WEBIF_TARGET="$2"
[ "$#" -lt 2 ] && {
echo "USAGE: $0 webif_base_file_folder build_folder"
exit 1
}
LANG_ROOT_FILE="languages.root"
create_lang_list() {
tmplanglst="${... | Shell |
#!/bin/sh
#
# Webif post-install script.
#
#########################################################################################
# functions
TestInstall()
{
this_version="__SVN_REVISION__"
installed_version=$(cat "${IPKG_INSTROOT}/www/.version")
if [ -f "/www/.version" ] && [ "$this_version" = "$installed_ver... | Shell |
#!/bin/sh
#
if [ -z "${IPKG_INSTROOT}" ]; then # only run below on 'real' system (not image builder)
# install new httpd.conf
if [ -f "/etc/httpd.conf" ]; then
cp /etc/httpd.conf /tmp/httpd.conf.old # make a copy for comparing
else
echo > /tmp/httpd.conf.old
fi
fi | Shell |
#!/bin/sh
#
if [ -z "${IPKG_INSTROOT}" ]; then # only run below on 'real' system (not image builder)
# install new httpd.conf
if [ -f "/etc/httpd.conf" ]; then
cp /etc/httpd.conf /tmp/httpd.conf.old # make a copy for comparing
else
echo > /tmp/httpd.conf.old
fi
fi | Shell |
#!/bin/sh
#
# Webif post-install script.
#
#########################################################################################
# functions
TestInstall()
{
this_version="__SVN_REVISION__"
installed_version=$(cat "${IPKG_INSTROOT}/www/.version")
if [ -f "/www/.version" ] && [ "$this_version" = "$installed_ver... | Shell |
#!/bin/sh
# Create default language list from translations.
# (c) 2008 Lubos Stanek - X-Wrt project
# Released under GPL license.
#
WEBIF_ROOT="$1"
WEBIF_TARGET="$2"
[ "$#" -lt 2 ] && {
echo "USAGE: $0 webif_base_file_folder build_folder"
exit 1
}
LANG_ROOT_FILE="languages.root"
create_lang_list() {
tmplanglst="${... | Shell |
#!/bin/sh
#
# this script embeds the global revision number in document(s) given
# on command line
# document should have __SVN_REVISION__ where it wants the revision
# number to be placed. Wildcards okay.
#
if [ $# -lt 1 ]; then
echo " Invalid usage. Must supply one or more files."
exit 1
fi
revision_number=$(svn ... | Shell |
#!/bin/sh
#
# Hotspot apply handler.
reload_hotspot() {
echo '@TR<<Exporting>> @TR<<hotspot settings>> ...'
[ -e /bin/save_hotspot ] && {
/bin/save_hotspot >&- 2>&-
}
(
config_cb() {
[ "$1" = "chillispot" ] && service_cfg="$2"
}
config_load "hotspot"
config_get_bool test "$service_cfg" enable 0
chilli_ini... | Shell |
#!/bin/sh
#
# Hotspot apply handler.
reload_hotspot() {
echo '@TR<<Exporting>> @TR<<hotspot settings>> ...'
[ -e /bin/save_hotspot ] && {
/bin/save_hotspot >&- 2>&-
}
(
config_cb() {
[ "$1" = "chillispot" ] && service_cfg="$2"
}
config_load "hotspot"
config_get_bool test "$service_cfg" enable 0
chilli_ini... | Shell |
#!/bin/sh
#
# Webif post-install script.
#
if $(grep -q "Mesh" "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"); then
sed -i '/##WEBIF:category:Mesh/a##WEBIF:category:HotSpot' "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"
else
sed -i '/##WEBIF:category:Network/a##WEBIF:category:HotSpot' "${IPKG_INSTROOT}/www/cgi-... | Shell |
#!/bin/sh
#
# Webif post-removal script.
#
sed -e '/##WEBIF:category:HotSpot/d' -i ${IPKG_INSTROOT}/www/cgi-bin/webif/.categories 2>/dev/null
| Shell |
#!/bin/sh
#
# Webif post-install script.
#
if $(grep -q "Mesh" "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"); then
sed -i '/##WEBIF:category:Mesh/a##WEBIF:category:HotSpot' "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"
else
sed -i '/##WEBIF:category:Network/a##WEBIF:category:HotSpot' "${IPKG_INSTROOT}/www/cgi-... | Shell |
#!/bin/sh
#
# Webif post-removal script.
#
sed -e '/##WEBIF:category:HotSpot/d' -i ${IPKG_INSTROOT}/www/cgi-bin/webif/.categories 2>/dev/null
| Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2008 x-wrt.org
######################################
# #
# Orginal script by ben@wildblue.de #
# #
######################################
###################################################################
# fon heartbeat script
#
# Description:
#
# Author(... | Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2008 x-wrt.org
######################################
# #
# Orginal script by ben@wildblue.de #
# #
######################################
###################################################################
# fon heartbeat script
#
# Description:
#
# Author(... | Shell |
#!/bin/sh
#
# Webif post-removal script.
#
echo "+ removing entry from cron"
sed -e '/fonheartbeat/d' -i /etc/crontabs/root
echo "+ restarting cron"
/etc/init.d/cron restart
echo "+ removing download.fon.com from knownhosts"
sed -e '/download.fon.com/d' -i /root/.ssh/known_hosts
| Shell |
#!/bin/sh
#
# Webif post-install script.
#
if [ ! -f /root/.ssh/known_hosts ]; then
echo "+ known_hosts not found, creating file"
touch /root/.ssh/known_hosts
fi
if [ "`cat /root/.ssh/known_hosts|grep download.fon.com`" = "" ]; then
echo "+ download.fon.com not found in known_hosts, adding download.fon.com"
echo "... | Shell |
#!/bin/sh
#
# Webif post-removal script.
#
echo "+ removing entry from cron"
sed -e '/fonheartbeat/d' -i /etc/crontabs/root
echo "+ restarting cron"
/etc/init.d/cron restart
echo "+ removing download.fon.com from knownhosts"
sed -e '/download.fon.com/d' -i /root/.ssh/known_hosts
| Shell |
#!/bin/sh
#
# Webif post-install script.
#
if [ ! -f /root/.ssh/known_hosts ]; then
echo "+ known_hosts not found, creating file"
touch /root/.ssh/known_hosts
fi
if [ "`cat /root/.ssh/known_hosts|grep download.fon.com`" = "" ]; then
echo "+ download.fon.com not found in known_hosts, adding download.fon.com"
echo "... | Shell |
# freeloader-include.sh created by m4rc0 02-03-2007
# version 1.3
###################################################################
# freeloader-include.sh
# (c)2007 X-Wrt project (http://www.x-wrt.org)
# (c)2007-03-02 m4rc0
#
# version 1.3
#
# Description:
# Holds the major setting for freeloader.
#
# Author(s) [in ... | Shell |
#!/bin/sh
#
# Webif post-removal script.
#
sed -e '/##WEBIF:category:Freeloader/d' -i ${IPKG_INSTROOT}/www/cgi-bin/webif/.categories 2>/dev/null | Shell |
#!/bin/sh
#
# Webif post-install script.
#
if $(grep -q "HotSpot" "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"); then
sed -i '/##WEBIF:category:HotSpot/a##WEBIF:category:Freeloader' "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"
elif $(grep -q "VPN" "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"); then
sed -i... | Shell |
#!/bin/sh
#
# Webif post-install script.
#
if $(grep -q "HotSpot" "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"); then
sed -i '/##WEBIF:category:HotSpot/a##WEBIF:category:Freeloader' "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"
elif $(grep -q "VPN" "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"); then
sed -i... | Shell |
#!/bin/sh
#
# Webif post-removal script.
#
sed -e '/##WEBIF:category:Freeloader/d' -i ${IPKG_INSTROOT}/www/cgi-bin/webif/.categories 2>/dev/null | Shell |
#!/bin/sh
#
# L2TPns apply script
# Applies the uci configuration to l2tpns' configuration file /etc/l2tpns/startup-config
#
# Author: Liran Tal <liran@enginx.com>
# <liran.tal@gmail.com>
#
# Last edited: 27 Nov 2007 - added support for proper restart of l2tpns service
#
#============================... | Shell |
#!/bin/sh
#
# L2TPns apply script
# Applies the uci configuration to l2tpns' configuration file /etc/l2tpns/startup-config
#
# Author: Liran Tal <liran@enginx.com>
# <liran.tal@gmail.com>
#
# Last edited: 27 Nov 2007 - added support for proper restart of l2tpns service
#
#============================... | Shell |
#!/bin/sh
NET=/tmp/net
LOG=$NET/log
SRV_USR=$NET/users
SRV_IPS=$NET/srv_ip
CLI_IPS=$NET/cli_ip
PATH=/sbin:/usr/sbin:$PATH
export PATH
[ -d $NET ] || mkdir -p $NET
rm_entry() {
grep -v "^$1 " $2 > $2.new
mv $2.new $2
}
clear_dev() {
for file in `grep -l "^$1 " $NET/*`; do
rm_entry $1 $file
done
}
#... | Shell |
#!/bin/sh
. /etc/functions-net.sh
USERS=/etc/ppp/users
PEERS=/etc/ppp/peers
# users.pptpd format:
# username password ip-address
# users.pptp format:
# peername username password ip-address
# peers.pptp format:
# peername host-name username
ppp_del_user() {
rm_entry "$2" $USERS.$1
}
ppp_add_user() {
ppp... | Shell |
#!/bin/sh
. /etc/functions-net.sh
USERS=/etc/ppp/users
PEERS=/etc/ppp/peers
# users.pptpd format:
# username password ip-address
# users.pptp format:
# peername username password ip-address
# peers.pptp format:
# peername host-name username
ppp_del_user() {
rm_entry "$2" $USERS.$1
}
ppp_add_user() {
ppp... | Shell |
#!/bin/sh
NET=/tmp/net
LOG=$NET/log
SRV_USR=$NET/users
SRV_IPS=$NET/srv_ip
CLI_IPS=$NET/cli_ip
PATH=/sbin:/usr/sbin:$PATH
export PATH
[ -d $NET ] || mkdir -p $NET
rm_entry() {
grep -v "^$1 " $2 > $2.new
mv $2.new $2
}
clear_dev() {
for file in `grep -l "^$1 " $NET/*`; do
rm_entry $1 $file
done
}
#... | Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2007 OpenWrt.org
# Liran Tal <liran@enginx.com> <liran.tal@gmail.com>
# Last updated: 16 August 2007
START=70
NAME=l2tpns
BIN=$(which $NAME 2>/dev/null)
DEFAULT=/etc/default/$NAME
RUN_D=/var/run
PID_F=$RUN_D/$NAME.pid
start() {
[ -z "$BIN" ] && return
[ -f $DEFAULT ] && . $D... | Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2007 OpenWrt.org
# Liran Tal <liran@enginx.com> <liran.tal@gmail.com>
# Last updated: 16 August 2007
START=70
NAME=l2tpns
BIN=$(which $NAME 2>/dev/null)
DEFAULT=/etc/default/$NAME
RUN_D=/var/run
PID_F=$RUN_D/$NAME.pid
start() {
[ -z "$BIN" ] && return
[ -f $DEFAULT ] && . $D... | Shell |
#!/bin/sh /etc/rc.common
START=60
report_log() {
[ "$#" -gt 0 ] && logger -s -t "webifopenvpn" "$@"
}
append_bool() {
local section="$1"
local option="$2"
local value="$3"
local _loctmp
config_get_bool _loctmp "$section" "$option"
[ "$_loctmp" -gt 0 ] && append args "$value"
}
append_parm() {
local section=... | Shell |
#!/bin/sh /etc/rc.common
START=60
report_log() {
[ "$#" -gt 0 ] && logger -s -t "webifopenvpn" "$@"
}
append_bool() {
local section="$1"
local option="$2"
local value="$3"
local _loctmp
config_get_bool _loctmp "$section" "$option"
[ "$_loctmp" -gt 0 ] && append args "$value"
}
append_parm() {
local section=... | Shell |
#!/bin/sh
if [ $# -lt 1 ]; then
echo "Usage: $0 USERNAME"
exit 1
fi
export SCP_USER="$1"
kamikaze_version="snapshots"
chmod -R 775 bin/*
#Broadcom 2.4
ls bin/openwrt-brcm-2.4* >/dev/null 2>&-
[ $? = "0" ] && {
version="brcm-2.4"
chmod 775 build_mipsel/webif-0.3/ipkg/webif/www/.version
version_file="bui... | Shell |
#!/bin/sh
if [ $# -lt 1 ]; then
echo "Usage: $0 USERNAME"
exit 1
fi
export SCP_USER="$1"
kamikaze_version="snapshots"
chmod -R 775 bin/*
#Broadcom 2.4
ls bin/openwrt-brcm-2.4* >/dev/null 2>&-
[ $? = "0" ] && {
version="brcm-2.4"
chmod 775 build_mipsel/webif-0.3/ipkg/webif/www/.version
version_file="bui... | Shell |
#!/bin/sh /etc/rc.common
START=46
start() {
[ $(uci get mesh.general.enable) ] || exit
# TODO: set wireless vars needed in mesh mode (frag, rts, mtu)
insmod ipt_mac.o
insmod ipt_LOG.o
iptables -N ipfilter
iptables -N mesh_nodes
iptables -N mesh_clients
iptables -N mesh_maintenance
/etc/firewall.mesh
}
stop()... | Shell |
#!/bin/sh /etc/rc.common
START=46
start() {
[ $(uci get mesh.general.enable) ] || exit
# TODO: set wireless vars needed in mesh mode (frag, rts, mtu)
insmod ipt_mac.o
insmod ipt_LOG.o
iptables -N ipfilter
iptables -N mesh_nodes
iptables -N mesh_clients
iptables -N mesh_maintenance
/etc/firewall.mesh
}
stop()... | Shell |
#!/bin/sh
#
# Webif post-removal script.
#
sed -e '/##WEBIF:category:Mesh/d' -i /www/cgi-bin/webif/.categories 2>/dev/null | Shell |
#!/bin/sh
#
# Webif post-removal script.
#
sed -e '/##WEBIF:category:Mesh/d' -i /www/cgi-bin/webif/.categories 2>/dev/null | Shell |
#!/bin/sh
#
# Webif post-install script.
#
cat "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories" |sed '/##WEBIF:category:Network/a\
##WEBIF:category:Mesh'>"${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"
| Shell |
#!/bin/sh
#
# Webif post-install script.
#
cat "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories" |sed '/##WEBIF:category:Network/a\
##WEBIF:category:Mesh'>"${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"
| Shell |
#!/bin/sh
#
# Webif post-removal script.
#
sed -e '/##WEBIF:category:Applications/d' -i ${IPKG_INSTROOT}/www/cgi-bin/webif/.categories 2>/dev/null
| Shell |
#!/bin/sh
#
# Webif post-install script.
#
if [ "`grep "Mesh" "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"`" = "##WEBIF:category:Mesh" ]; then
cat "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories" |sed '/##WEBIF:category:Mesh/a\
##WEBIF:category:Applications'>"${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"
else
c... | Shell |
#!/bin/sh
#
# Webif post-removal script.
#
sed -e '/##WEBIF:category:Applications/d' -i ${IPKG_INSTROOT}/www/cgi-bin/webif/.categories 2>/dev/null
| Shell |
#!/bin/sh
#
# Webif post-install script.
#
if [ "`grep "Mesh" "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"`" = "##WEBIF:category:Mesh" ]; then
cat "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories" |sed '/##WEBIF:category:Mesh/a\
##WEBIF:category:Applications'>"${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"
else
c... | Shell |
#!/bin/sh
#
# Webif post-removal script.
#
sed -e '/##WEBIF:category:HotSpot/d' -i ${IPKG_INSTROOT}/www/cgi-bin/webif/.categories 2>/dev/null
| Shell |
#!/bin/sh
#
# Webif post-removal script.
#
sed -e '/##WEBIF:category:HotSpot/d' -i ${IPKG_INSTROOT}/www/cgi-bin/webif/.categories 2>/dev/null
| Shell |
#!/bin/sh
#
# this script embeds the global revision number in document(s) given
# on command line
# document should have __SVN_REVISION__ where it wants the revision
# number to be placed. Wildcards okay.
#
if [ $# -lt 1 ]; then
echo " Invalid usage. Must supply one or more files."
exit 1
fi
revision_number=$(svn ... | Shell |
#!/bin/sh
#this file contains any needed fixes to old functions that may have changed in newer versions.
#helps keep the webif compatable with older versions.
config_load() {
local cfg
local uci
local PACKAGE="$1"
case "$PACKAGE" in
/*) cfg="$PACKAGE"
uci=""
;;
*) cfg="$UCI_ROOT/etc/config/$PACKAGE"
u... | Shell |
#!/bin/sh
#
# Webif^2 utility functions - X-Wrt
#
# This file is compatible with White Russian and Kamikaze.
#
. /etc/functions.sh
[ -f /etc/functions_ex.sh ] && {
. /etc/functions_ex.sh
}
#
# Misc. functions
#
# workarounds for stupid busybox slowness on [ ]
empty() {
case "$1" in
"") return 0 ;;
*) return 255 ... | Shell |
#!/bin/sh
themes_lst="/etc/themes.lst"
tmpthemeslst=$(mktemp "/tmp/.webif-XXXXXX")
ipkg list | awk '/webif-theme/ { gsub("webif-theme-",""); if ($5) print "option|"$1"|"$5}' | sort | uniq >> "$tmpthemeslst"
if [ "'cat $tmpthemeslst'" != "" ]; then
if [ "'cat $tmpthemeslst'" != "'cat $themes_lst'" ]; then
rm -f "$the... | Shell |
#!/bin/ash
#
#
# Handler for config application of all types.
#
# Types supported:
# uci-* UCI config files
# file-* Undefined format for whatever
# edited-files-* raw edited files
#
#
. /usr/lib/webif/functions.sh
. /lib/config/uci.sh
HANDLERS_file='
hosts) rm -f /etc/hosts; mv $config /etc/hosts; killall -HUP ... | Shell |
#!/bin/sh
themes_lst="/etc/themes.lst"
tmpthemeslst=$(mktemp "/tmp/.webif-XXXXXX")
ipkg list | awk '/webif-theme/ { gsub("webif-theme-",""); if ($5) print "option|"$1"|"$5}' | sort | uniq >> "$tmpthemeslst"
if [ "'cat $tmpthemeslst'" != "" ]; then
if [ "'cat $tmpthemeslst'" != "'cat $themes_lst'" ]; then
rm -f "$the... | Shell |
#!/bin/sh
#this file contains any needed fixes to old functions that may have changed in newer versions.
#helps keep the webif compatable with older versions.
config_load() {
local cfg
local uci
local PACKAGE="$1"
case "$PACKAGE" in
/*) cfg="$PACKAGE"
uci=""
;;
*) cfg="$UCI_ROOT/etc/config/$PACKAGE"
u... | Shell |
#!/bin/sh
languages_lst="/etc/languages.lst"
tmplanglst=$(mktemp "/tmp/.webif-XXXXXX")
echo "option|en|English" > "$tmplanglst"
ipkg list | awk '/webif-lang/ { gsub("webif-lang-",""); if ($5) print "option|"$1"|"$5}' | sort | uniq >> "$tmplanglst"
if [ "'cat $tmplanglst'" != "option|en|English" ]; then
if [ "'cat $tm... | Shell |
#!/bin/ash
#
#
# Handler for config application of all types.
#
# Types supported:
# uci-* UCI config files
# file-* Undefined format for whatever
# edited-files-* raw edited files
#
#
. /usr/lib/webif/functions.sh
. /lib/config/uci.sh
HANDLERS_file='
hosts) rm -f /etc/hosts; mv $config /etc/hosts; killall -HUP ... | Shell |
#!/bin/sh
#
# Webif^2 utility functions - X-Wrt
#
# This file is compatible with White Russian and Kamikaze.
#
. /etc/functions.sh
[ -f /etc/functions_ex.sh ] && {
. /etc/functions_ex.sh
}
#
# Misc. functions
#
# workarounds for stupid busybox slowness on [ ]
empty() {
case "$1" in
"") return 0 ;;
*) return 255 ... | Shell |
#!/bin/sh
languages_lst="/etc/languages.lst"
tmplanglst=$(mktemp "/tmp/.webif-XXXXXX")
echo "option|en|English" > "$tmplanglst"
ipkg list | awk '/webif-lang/ { gsub("webif-lang-",""); if ($5) print "option|"$1"|"$5}' | sort | uniq >> "$tmplanglst"
if [ "'cat $tmplanglst'" != "option|en|English" ]; then
if [ "'cat $tm... | Shell |
######################################################
# Webif base
#
# Description:
# Holds primary functions. Header, footer, etc..
#
# Author(s) [in order of work date]:
# A variety of people. Several X-Wrt developers.
#
# Major revisions:
#
# Configuration files referenced:
#
libdir=/usr/lib/webif
ww... | Shell |
#!/bin/sh
NET=/tmp/net
LOG=$NET/log
SRV_USR=$NET/users
SRV_IPS=$NET/srv_ip
CLI_IPS=$NET/cli_ip
PATH=/sbin:/usr/sbin:$PATH
export PATH
[ -d $NET ] || mkdir -p $NET
rm_entry() {
grep -v "^$1 " $2 > $2.new
mv $2.new $2
}
clear_dev() {
for file in `grep -l "^$1 " $NET/*`; do
rm_entry $1 $file
done
}
#... | Shell |
#!/bin/sh
. /etc/functions-net.sh
USERS=/etc/ppp/users
PEERS=/etc/ppp/peers
# users.pptpd format:
# username password ip-address
# users.pptp format:
# peername username password ip-address
# peers.pptp format:
# peername host-name username
ppp_del_user() {
rm_entry "$2" $USERS.$1
}
ppp_add_user() {
ppp... | Shell |
#!/bin/sh
. /etc/functions-net.sh
USERS=/etc/ppp/users
PEERS=/etc/ppp/peers
# users.pptpd format:
# username password ip-address
# users.pptp format:
# peername username password ip-address
# peers.pptp format:
# peername host-name username
ppp_del_user() {
rm_entry "$2" $USERS.$1
}
ppp_add_user() {
ppp... | Shell |
#!/bin/sh
NET=/tmp/net
LOG=$NET/log
SRV_USR=$NET/users
SRV_IPS=$NET/srv_ip
CLI_IPS=$NET/cli_ip
PATH=/sbin:/usr/sbin:$PATH
export PATH
[ -d $NET ] || mkdir -p $NET
rm_entry() {
grep -v "^$1 " $2 > $2.new
mv $2.new $2
}
clear_dev() {
for file in `grep -l "^$1 " $NET/*`; do
rm_entry $1 $file
done
}
#... | Shell |
#!/bin/sh /etc/rc.common
# backup dmesg
#
START=99
dmesgbackup_config() {
local cfg="$1"
local enabled file gzip GZIP_CMD
local DEFAULT_enabled=0
local DEFAULT_file="/var/log/dmesg"
local DEFAULT_gzip=1
config_get_bool enabled "$cfg" enabled "$DEFAULT_enabled"
[ "$enabled" -eq 1 ] && {
config_get file "$cfg"... | Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2007 OpenWrt.org
# Liran Tal <liran@enginx.com> <liran.tal@gmail.com>
# Last updated: 16 August 2007
START=70
NAME=l2tpns
BIN=$(which $NAME 2>/dev/null)
DEFAULT=/etc/default/$NAME
RUN_D=/var/run
PID_F=$RUN_D/$NAME.pid
start() {
[ -z "$BIN" ] && return
[ -f $DEFAULT ] && . $D... | Shell |
#!/bin/sh /etc/rc.common
# This file is not compatible with White Russian and Kamikaze.
#
# identification of the device
#
START=90
start() {
. /lib/config/uci.sh
. /usr/lib/webif/functions.sh
uci_load "webif"
#detect device
device_name="$CONFIG_general_device_name"
[ -z "$device_name" ] && [ -f "/proc/diag/mode... | Shell |
#!/bin/sh /etc/rc.common
START=90
# place your own startup commands here
#
# REMEMBER: You *MUST* place an '&' after launching programs you
# that are to continue running in the background.
#
# i.e.
# BAD: upnpd
# GOOD: upnpd &
#
# Failure to do this will result in the startup process halting
# on this file... | Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2007 X-Wrt.org
START=91
EXTRA_COMMANDS="status"
EXTRA_HELP=" status Show current status
"
load_variables() {
[ "$webifssl_config_loaded" != "1" ] && {
config_load webifssl
DEFAULT_pidfile="/var/run/webifssl.pid"
DEFAULT_certs_cafile="/etc/ssl/matrixtunnel.cert"
DEFAU... | Shell |
#!/bin/sh /etc/rc.common
START=11
timezone_config() {
local cfg="$1"
local posixtz
local etctz="/etc/TZ"
config_get posixtz "$cfg" posixtz
if [ ! -h $etctz ]; then
ln -sf /tmp/TZ "$etctz"
fi
[ -n "$posixtz" ] && echo "$posixtz" > "$etctz" || echo "UTC+0" > "$etctz"
}
start() {
config_load timezone
conf... | Shell |
#!/bin/sh /etc/rc.common
START=01
syslogd_bin="/sbin/syslogd"
dmesg_bin="/bin/dmesg"
klogd_bin="/sbin/klogd"
syslogd_config() {
local cfg="$1"
local mark type file size ipaddr port IPCALC_CMD SYSLOG_CMD
local DEFAULT_mark=0
local DEFAULT_type="circular"
local DEFAULT_file="/var/log/messages"
local DEFAULT_siz... | Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2007 X-Wrt.org
START=91
EXTRA_COMMANDS="status"
EXTRA_HELP=" status Show current status
"
load_variables() {
[ "$webifssl_config_loaded" != "1" ] && {
config_load webifssl
DEFAULT_pidfile="/var/run/webifssl.pid"
DEFAULT_certs_cafile="/etc/ssl/matrixtunnel.cert"
DEFAU... | Shell |
#!/bin/sh /etc/rc.common
START=90
start() {
. /lib/config/uci.sh
. /usr/lib/webif/functions.sh
uci_load "webif"
config_get enabled firewall log
if [ "$enabled" = "1" ]; then
iptables -A input_rule -j LOG --log-prefix "input_rule:DROP "
iptables -A forwarding_rule -j LOG --log-prefix "forwarding_rule:DROP "
i... | Shell |
#!/bin/sh /etc/rc.common
START=90
# place your own startup commands here
#
# REMEMBER: You *MUST* place an '&' after launching programs you
# that are to continue running in the background.
#
# i.e.
# BAD: upnpd
# GOOD: upnpd &
#
# Failure to do this will result in the startup process halting
# on this file... | Shell |
#!/bin/sh /etc/rc.common
# This file is not compatible with White Russian and Kamikaze.
#
# identification of the device
#
START=90
start() {
. /lib/config/uci.sh
. /usr/lib/webif/functions.sh
uci_load "webif"
#detect device
device_name="$CONFIG_general_device_name"
[ -z "$device_name" ] && [ -f "/proc/diag/mode... | Shell |
#!/bin/sh /etc/rc.common
START=11
timezone_config() {
local cfg="$1"
local posixtz
local etctz="/etc/TZ"
config_get posixtz "$cfg" posixtz
if [ ! -h $etctz ]; then
ln -sf /tmp/TZ "$etctz"
fi
[ -n "$posixtz" ] && echo "$posixtz" > "$etctz" || echo "UTC+0" > "$etctz"
}
start() {
config_load timezone
conf... | Shell |
#!/bin/sh /etc/rc.common
# backup dmesg
#
START=99
dmesgbackup_config() {
local cfg="$1"
local enabled file gzip GZIP_CMD
local DEFAULT_enabled=0
local DEFAULT_file="/var/log/dmesg"
local DEFAULT_gzip=1
config_get_bool enabled "$cfg" enabled "$DEFAULT_enabled"
[ "$enabled" -eq 1 ] && {
config_get file "$cfg"... | Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2007 OpenWrt.org
# Liran Tal <liran@enginx.com> <liran.tal@gmail.com>
# Last updated: 16 August 2007
START=70
NAME=l2tpns
BIN=$(which $NAME 2>/dev/null)
DEFAULT=/etc/default/$NAME
RUN_D=/var/run
PID_F=$RUN_D/$NAME.pid
start() {
[ -z "$BIN" ] && return
[ -f $DEFAULT ] && . $D... | Shell |
#!/bin/sh /etc/rc.common
START=60
. /lib/config/uci.sh
uci_load openvpn
status="0"
file_check() {
for file in "$@"; do
if [ ! -f "$file" ]; then
logger "$0: Missing $file. Please generate and try again."
status="1"
fi
done
}
start() {
case "$CONFIG_general_mode" in
client)
SERVER="$CONFIG_client_ipa... | Shell |
#!/bin/sh /etc/rc.common
START=01
syslogd_bin="/sbin/syslogd"
dmesg_bin="/bin/dmesg"
klogd_bin="/sbin/klogd"
syslogd_config() {
local cfg="$1"
local mark type file size ipaddr port IPCALC_CMD SYSLOG_CMD
local DEFAULT_mark=0
local DEFAULT_type="circular"
local DEFAULT_file="/var/log/messages"
local DEFAULT_siz... | Shell |
#!/bin/sh /etc/rc.common
START=60
. /lib/config/uci.sh
uci_load openvpn
status="0"
file_check() {
for file in "$@"; do
if [ ! -f "$file" ]; then
logger "$0: Missing $file. Please generate and try again."
status="1"
fi
done
}
start() {
case "$CONFIG_general_mode" in
client)
SERVER="$CONFIG_client_ipa... | Shell |
#!/bin/sh /etc/rc.common
START=90
start() {
. /lib/config/uci.sh
. /usr/lib/webif/functions.sh
uci_load "webif"
config_get enabled firewall log
if [ "$enabled" = "1" ]; then
iptables -A input_rule -j LOG --log-prefix "input_rule:DROP "
iptables -A forwarding_rule -j LOG --log-prefix "forwarding_rule:DROP "
i... | Shell |
#!/bin/sh
#
# Webif post-install script.
#
#########################################################################################
# functions
TestInstall()
{
this_version="__SVN_REVISION__"
installed_version=$(cat "${IPKG_INSTROOT}/www/.version")
if [ -f "/www/.version" ] && [ "$this_version" = "$installed_ver... | Shell |
#!/bin/sh
#
if [ -z "${IPKG_INSTROOT}" ]; then # only run below on 'real' system (not image builder)
# install new httpd.conf
if [ -f "/etc/httpd.conf" ]; then
cp /etc/httpd.conf /tmp/httpd.conf.old # make a copy for comparing
else
echo > /tmp/httpd.conf.old
fi
fi
#Save current webif settings
if [ -e ... | Shell |
#!/bin/sh
#
if [ -z "${IPKG_INSTROOT}" ]; then # only run below on 'real' system (not image builder)
# install new httpd.conf
if [ -f "/etc/httpd.conf" ]; then
cp /etc/httpd.conf /tmp/httpd.conf.old # make a copy for comparing
else
echo > /tmp/httpd.conf.old
fi
fi
#Save current webif settings
if [ -e ... | Shell |
#!/bin/sh
#
# Webif post-install script.
#
#########################################################################################
# functions
TestInstall()
{
this_version="__SVN_REVISION__"
installed_version=$(cat "${IPKG_INSTROOT}/www/.version")
if [ -f "/www/.version" ] && [ "$this_version" = "$installed_ver... | Shell |
#!/bin/sh
#
# this script embeds the global revision number in document(s) given
# on command line
# document should have __SVN_REVISION__ where it wants the revision
# number to be placed. Wildcards okay.
#
if [ $# -lt 1 ]; then
echo " Invalid usage. Must supply one or more files."
exit 1
fi
revision_number=$(svn ... | Shell |
#!/usr/bin/webif-page
<?
#
# credit goes to luke-jr+openwrt@utopios.org
#
# TODO: this page violates our CSS standards by having style defined in it.
#
#
. /usr/lib/webif/webif.sh
header "System" "NVRAM" "@TR<<NVRAM>>" '' ''
ShowNotUpdatedWarning
?>
<style type="text/css">
td {
vertical-align: top;
padding-lef... | Shell |
#!/bin/sh
firmware_name=$(nvram get firmware_name)
firmware_version=$(nvram get firmware_version)
if [ -z "$firmware_name" ]; then
nvram set firmware_name="OpenWrt White Russian"
nvram set firmware_subtitle="With X-Wrt Extensions"
fi
if grep -q "RC5" "/etc/banner"; then
if [ "$firmware_version" != "RC5" ]; then
nv... | Shell |
#!/bin/sh
firmware_name=$(nvram get firmware_name)
firmware_version=$(nvram get firmware_version)
if [ -z "$firmware_name" ]; then
nvram set firmware_name="OpenWrt White Russian"
nvram set firmware_subtitle="With X-Wrt Extensions"
fi
if grep -q "RC5" "/etc/banner"; then
if [ "$firmware_version" != "RC5" ]; then
nv... | Shell |
#!/bin/sh
# invoke ntp server based on nvrams vars ntp_server and time_zone
if [ -f "/usr/sbin/ntpclient" ] || \
[ -f "/usr/bin/ntpclient" ] || \
[ -f "/sbin/ntpclient" ] || \
[ -f "/bin/ntpclient" ]; then
# create symlink to /tmp/TZ if /etc/TZ doesn't exist
# todo: -e | -f | -d didn't seem to work here, so I u... | Shell |
#!/bin/sh
. /etc/ppp/functions.sh
getpid() { echo -n $(ps aux|grep -v grep|grep "pppd call pptp:$1"|awk '{print $1}'); }
runppp() { pppd call pptp:$1 updetach; }
case "$1" in
start)
build_chap_secrets
for module in slhc ppp_generic ppp_async ip_gre arc4 sha1 ppp_mppe_mppc; do
/sbin/insmod $module 2>&- >&... | Shell |
#!/bin/sh
killall -q dnsmasq
pppoa_ifname="atm0" # hack for ppp over atm, which has no ${proto}_ifname
args2=""
#
# initialize any missing nvram variables and turn on dhcp
# for LAN by default.
#
if [ -z $(nvram get lan_dhcp_enabled) ]; then
nvram set lan_dhcp_enabled=1
fi
for ifname in lan wan wifi $(nvram g... | Shell |
#!/bin/sh
#
# ez-ipupdate Starts ez-ipupdate
#
RUN_D=/var/run
PID_F=$RUN_D/ez-ipupdate.pid
ddns_dir="/etc/ez-ipupdate"
ddns_cache="$ddns_dir/ez-ipupdate.cache"
ddns_conf="$ddns_dir/ez-ipupdate.conf"
ddns_msg="$ddns_dir/ez-ipupdate.msg"
ddns_exec_ok="$ddns_dir/ez-ipupdate-ok.sh"
getPID(){
if [ -f $PID_F ]; the... | Shell |
#!/bin/sh
killall -q dnsmasq
pppoa_ifname="atm0" # hack for ppp over atm, which has no ${proto}_ifname
args2=""
#
# initialize any missing nvram variables and turn on dhcp
# for LAN by default.
#
if [ -z $(nvram get lan_dhcp_enabled) ]; then
nvram set lan_dhcp_enabled=1
fi
for ifname in lan wan wifi $(nvram g... | Shell |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.