code stringlengths 1 1.96M | language stringclasses 1
value |
|---|---|
#!/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.
#
sed -i '/##WEBIF:category:Network/a##WEBIF:category:Mesh' "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"
| Shell |
#!/bin/sh
#
# Webif post-install script.
#
sed -i '/##WEBIF:category:Network/a##WEBIF:category:Mesh' "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"
| Shell |
#!/bin/sh
# Copyright (C) 2009 Fabian Omar Franzotti <fofware@gmail.com>
. /lib/mroute/common-mroute
local iftype=$(uci_get "mroute.$INTERFACE")
[ -z "$iftype" ] && exit 0
add_to_existing () {
local table
config_get table $1 rt_table
[ -z "$table" ] && return
add_net_to_rt $INTERFACE "add_to_existing" $table $ne... | Shell |
#!/bin/sh
# Copyright (C) 2009 Fabian Omar Franzotti <fofware@gmail.com>
. /lib/mroute/common-mroute
local iftype=$(uci_get "mroute.$INTERFACE")
[ -z "$iftype" ] && exit 0
add_to_existing () {
local table
config_get table $1 rt_table
[ -z "$table" ] && return
add_net_to_rt $INTERFACE "add_to_existing" $table $ne... | Shell |
#!/bin/sh
. /etc/functions.sh
. /lib/mroute/common-mroute
make_wan_list () {
local gateway
local device
local proto
config_get device $1 device
config_get gateway $1 gateway
config_get proto $1 proto
[ -z "$device" -o -z "$gateway" -o -z "$proto" ] && return
# local ipaddr
# local network
# local mark
local na... | Shell |
#!/bin/sh
. /etc/functions.sh
. /lib/mroute/common-mroute
make_wan_list () {
local gateway
local device
local proto
config_get device $1 device
config_get gateway $1 gateway
config_get proto $1 proto
[ -z "$device" -o -z "$gateway" -o -z "$proto" ] && return
# local ipaddr
# local network
# local mark
local na... | 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 -q "Mesh" "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"); then
sed -i '/##WEBIF:category:Mesh/a##WEBIF:category:Applications' "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"
else
sed -i '/##WEBIF:category:Network/a##WEBIF:category:Applications' "${IPKG_INSTROOT... | 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 -q "Mesh" "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"); then
sed -i '/##WEBIF:category:Mesh/a##WEBIF:category:Applications' "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"
else
sed -i '/##WEBIF:category:Network/a##WEBIF:category:Applications' "${IPKG_INSTROOT... | 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
#
# Webif^2 utility functions - X-Wrt
#
. /etc/functions.sh
#
# Misc. functions
#
# workarounds for stupid busybox slowness on [ ]
empty() {
case "$1" in
"") return 0 ;;
*) return 255 ;;
esac
}
equal() {
case "$1" in
"$2") return 0 ;;
*) return 255 ;;
esac
}
neq() {
case "$1" in
"$2") retur... | Shell |
#!/bin/sh
themes_lst="/etc/themes.lst"
tmpthemeslst=$(mktemp "/tmp/.webif-XXXXXX")
opkg 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
config_cb() {
[ "$1" = "system" ] && system_cfg="$2"
[ "$1" = "server" ] && ... | Shell |
#!/bin/sh
themes_lst="/etc/themes.lst"
tmpthemeslst=$(mktemp "/tmp/.webif-XXXXXX")
opkg 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
LANGLIST_NEEDS_UPDATE=0
languages_root="/etc/languages.root"
languages_lst="/etc/languages.lst"
if [ ! -f "$languages_lst" ]; then
cp -pf "$languages_root" "$languages_lst" 2>/dev/null
fi
lists_path=$(cat /etc/opkg.conf 2>/dev/null | grep ^lists_dir | cut -d' ' -f3)
if [ -z "$lists_path" ]; then
lists_path=... | 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
config_cb() {
[ "$1" = "system" ] && system_cfg="$2"
[ "$1" = "server" ] && ... | Shell |
#!/bin/sh
#
# Webif^2 utility functions - X-Wrt
#
. /etc/functions.sh
#
# Misc. functions
#
# workarounds for stupid busybox slowness on [ ]
empty() {
case "$1" in
"") return 0 ;;
*) return 255 ;;
esac
}
equal() {
case "$1" in
"$2") return 0 ;;
*) return 255 ;;
esac
}
neq() {
case "$1" in
"$2") retur... | Shell |
#!/bin/sh
LANGLIST_NEEDS_UPDATE=0
languages_root="/etc/languages.root"
languages_lst="/etc/languages.lst"
if [ ! -f "$languages_lst" ]; then
cp -pf "$languages_root" "$languages_lst" 2>/dev/null
fi
lists_path=$(cat /etc/opkg.conf 2>/dev/null | grep ^lists_dir | cut -d' ' -f3)
if [ -z "$lists_path" ]; then
lists_path=... | 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 /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
#
# 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
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
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 type file size ipaddr port IPCALC_CMD SYSLOG_CMD
local DEFAULT_type="circular"
local DEFAULT_file="/var/log/messages"
local DEFAULT_size=16
local DEFAULT_ipaddr=... | 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
#
# 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=01
syslogd_bin="/sbin/syslogd"
dmesg_bin="/bin/dmesg"
klogd_bin="/sbin/klogd"
syslogd_config() {
local cfg="$1"
local type file size ipaddr port IPCALC_CMD SYSLOG_CMD
local DEFAULT_type="circular"
local DEFAULT_file="/var/log/messages"
local DEFAULT_size=16
local DEFAULT_ipaddr=... | 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 |
#!/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 |
#!/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
# 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
#
# This is an ugly solution, but no better one developed yet.
# We want to allow user to install a service but keep it disabled.
# This is important in cases where the package is pre-installed,
# for example on micro distributions.
#
# Without mandating use of packages that have startup scripts that
# adhere... | 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
#
# This is an ugly solution, but no better one developed yet.
# We want to allow user to install a service but keep it disabled.
# This is important in cases where the package is pre-installed,
# for example on micro distributions.
#
# Without mandating use of packages that have startup scripts that
# adhere... | 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
# Firewall addons for meshing purpose
# TODO: add some if statements to switch between routing protocols
# TODO: clean dirty and put some order in tables and chains
test -n "$FAILSAFE" && exit
# wl driver need time to complete loading
sleep 2
test -z "$(l=$(grep : /proc/net/wireless);l=${l%:*};echo ${l##* })... | Shell |
#!/bin/sh
# Firewall addons for meshing purpose
# TODO: add some if statements to switch between routing protocols
# TODO: clean dirty and put some order in tables and chains
test -n "$FAILSAFE" && exit
# wl driver need time to complete loading
sleep 2
test -z "$(l=$(grep : /proc/net/wireless);l=${l%:*};echo ${l##* })... | Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 Michele Favara Pedarsi <mik.fp@commentaria.com>
# derivative work from the good folks at freifunk.net
# licensed under GPL (any version at any time)
#
# NOTE: ff_* vars are freifunk features;
# as I cannot guarrantee to mantain the code
# I left the ff_* vars a... | Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 Michele Favara Pedarsi <mik.fp@commentaria.com>
# derivative work from the good folks at freifunk.net
# licensed under GPL (any version at any time)
#
# NOTE: ff_* vars are freifunk features;
# as I cannot guarrantee to mantain the code
# I left the ff_* vars a... | 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
config_cb() {
config_get TYPE "$CONFIG_SECTION" TYPE
case "$TYPE" in
webifopenvpn)
append openvpnconfigs "$CONFIG_SECTION" "$N"
;;
esac
}
report_log() {
[ "$#" -gt 0 ] && logger -s -t "webifopenvpn" "$@"
}
append_bool() {
local section="ovpn"
local option="$1"
local v... | Shell |
#!/bin/sh /etc/rc.common
START=60
config_cb() {
config_get TYPE "$CONFIG_SECTION" TYPE
case "$TYPE" in
webifopenvpn)
append openvpnconfigs "$CONFIG_SECTION" "$N"
;;
esac
}
report_log() {
[ "$#" -gt 0 ] && logger -s -t "webifopenvpn" "$@"
}
append_bool() {
local section="ovpn"
local option="$1"
local v... | 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.
#
sed -i '/##WEBIF:category:Network/a##WEBIF:category:Mesh' "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"
| Shell |
#!/bin/sh
#
# Webif post-install script.
#
sed -i '/##WEBIF:category:Network/a##WEBIF:category:Mesh' "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"
| Shell |
#!/bin/sh /etc/rc.common
START=59
EXTRA_COMMANDS="configuration"
EXTRA_HELP=" config write configuration file"
RUN_D=/var/run
PID_F=$RUN_D/chilli.pid
CONF_FILE=/etc/chilli.conf
STATE_DIR="./"
DHCP_IF=
uci_get() {
uci -P /var/state get "$1" 2>/dev/null
}
error_msg() {
echo
echo $1
echo " Chilli don't start"
... | Shell |
#!/bin/sh /etc/rc.common
START=59
EXTRA_COMMANDS="configuration"
EXTRA_HELP=" config write configuration file"
RUN_D=/var/run
PID_F=$RUN_D/chilli.pid
CONF_FILE=/etc/chilli.conf
STATE_DIR="./"
DHCP_IF=
uci_get() {
uci -P /var/state get "$1" 2>/dev/null
}
error_msg() {
echo
echo $1
echo " Chilli don't start"
... | 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/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/ash
#
#
# Handler for MARS config.
#
#
. /usr/lib/webif/webif.sh
. /www/cgi-bin/webif/ast_functions.sh
echo '<center><strong>Asterisk Configuration</strong><br>'
uci_load mars
FOUND=$(grep -s system /tmp/.uci/mars)
if [ "$FOUND" != "" ]; then
echo 'System modified'
fi
FOUND=$(grep -s "extensions" /tmp/.uci/m... | Shell |
#!/bin/ash
#
#
# Handler for MARS config.
#
#
. /usr/lib/webif/webif.sh
. /www/cgi-bin/webif/ast_functions.sh
echo '<center><strong>Asterisk Configuration</strong><br>'
uci_load mars
FOUND=$(grep -s system /tmp/.uci/mars)
if [ "$FOUND" != "" ]; then
echo 'System modified'
fi
FOUND=$(grep -s "extensions" /tmp/.uci/m... | Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=50
#DEST=/
DEST=""
DEFAULT=/etc/default/asterisk
# DEFAULT=$DEST/etc/default/asterisk
OPTIONS=""
start() {
[ -f $DEFAULT ] && . $DEFAULT
# [ -d $DEST/var/run ] || mkdir -p $DEST/var/run
# [ -d $DEST/var/log/asterisk ] || mkdir -p $DEST/var/log/asterisk... | Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=50
#DEST=/
DEST=""
DEFAULT=/etc/default/asterisk
# DEFAULT=$DEST/etc/default/asterisk
OPTIONS=""
start() {
[ -f $DEFAULT ] && . $DEFAULT
# [ -d $DEST/var/run ] || mkdir -p $DEST/var/run
# [ -d $DEST/var/log/asterisk ] || mkdir -p $DEST/var/log/asterisk... | 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) 2006 OpenWrt.org
START=50
start()
{
include /lib/network
scan_interfaces
config_get ifname wan hostname
[ -d /www ] && httpd -p 80 -h /www -r ${hostname:-OpenWrt}
### WebCallDisabled=$(nvram get "AST_WebCallDisabled")
### WebCallDisabled=$(uci get mars.system.AST_We... | 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) 2006 OpenWrt.org
START=50
start()
{
include /lib/network
scan_interfaces
config_get ifname wan hostname
[ -d /www ] && httpd -p 80 -h /www -r ${hostname:-OpenWrt}
### WebCallDisabled=$(nvram get "AST_WebCallDisabled")
### WebCallDisabled=$(uci get mars.system.AST_We... | Shell |
#!/bin/sh
# Copyright (C) 2009 Fabian Omar Franzotti <fofware@gmail.com>
# http://pastebin.ca/2098184
#
#include /lib/network
. /etc/functions.sh
. /lib/config/uci.sh
local INTERFACE="$INTERFACE"
local DEVICE="$DEVICE"
saveundo () {
[ ! -e /var/mroute/$DEVICE ] && mkdir -p /var/mroute/$DEVICE
[ ! -e /var/mroute/$D... | Shell |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.