code
stringlengths
1
1.96M
language
stringclasses
1 value
#!/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 "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:HotSpot'>"${IPKG_INSTROOT}/www/cgi-bin/webif/.categories" else cat "$...
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 "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:HotSpot'>"${IPKG_INSTROOT}/www/cgi-bin/webif/.categories" else cat "$...
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/ash /etc/init.d/network restart sleep 3 killall dnsmasq if [ -f /etc/rc.d/S??dnsmasq ]; then /etc/init.d/dnsmasq start fi sleep 3 wifi
Shell
#!/bin/ash /etc/init.d/network restart sleep 3 killall dnsmasq if [ -f /etc/rc.d/S??dnsmasq ]; then /etc/init.d/dnsmasq start fi sleep 3 wifi
Shell
#!/bin/ash /etc/init.d/network restart sleep 3 killall dnsmasq if [ -f /etc/rc.d/S??dnsmasq ]; then /etc/init.d/dnsmasq start fi sleep 3 wifi
Shell
#!/bin/ash /etc/init.d/network restart sleep 3 killall dnsmasq if [ -f /etc/rc.d/S??dnsmasq ]; then /etc/init.d/dnsmasq start fi sleep 3 wifi
Shell
#!/bin/sh # # IW-chillispot post-removal script. # # sed -e '/##WEBIF:category:HotSpot/d' -i ${IPKG_INSTROOT}/www/cgi-bin/webif/.categories 2>/dev/null sed -e '/#### Olsrd firewall configuration/,/#### Olsrd end/ d' /etc/firewall.user | cat > /etc/firewall.user
Shell
#!/bin/sh # # IW-chillispot post-removal script. # # sed -e '/##WEBIF:category:HotSpot/d' -i ${IPKG_INSTROOT}/www/cgi-bin/webif/.categories 2>/dev/null sed -e '/#### Olsrd firewall configuration/,/#### Olsrd end/ d' /etc/firewall.user | cat > /etc/firewall.user
Shell
#!/bin/sh # # IW-Web post-removal script. #
Shell
#!/bin/sh # # IW-Web post-removal script. #
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 "HotSpot" "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"`" = "##WEBIF:category:HotSpot" ]; then cat "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories" |sed '/##WEBIF:category:HotSpot/a\ ##WEBIF:category:Freeloader'>"${IPKG_INSTROOT}/www/cgi-bin/webif/.categories" ...
Shell
#!/bin/sh # # Webif post-install script. # if [ "`grep "HotSpot" "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"`" = "##WEBIF:category:HotSpot" ]; then cat "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories" |sed '/##WEBIF:category:HotSpot/a\ ##WEBIF:category:Freeloader'>"${IPKG_INSTROOT}/www/cgi-bin/webif/.categories" ...
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 # Coova Chilli - David Bird <david@coova.com> # Licensed under the GPL, see http://coova.org/ # up.sh /dev/tun0 192.168.0.10 255.255.255.0 . /etc/chilli/functions [ -e "/var/run/chilli.iptables" ] && sh /var/run/chilli.iptables 2>/dev/null rm -f /var/run/chilli.iptables 2>/dev/null IF=$(basename $DEV) ipt...
Shell
#!/bin/sh # Coova Chilli - David Bird <david@coova.com> # Licensed under the GPL, see http://coova.org/ # up.sh /dev/tun0 192.168.0.10 255.255.255.0 . /etc/chilli/functions [ -e "/var/run/chilli.iptables" ] && sh /var/run/chilli.iptables 2>/dev/null rm -f /var/run/chilli.iptables 2>/dev/null IF=$(basename $DEV) ipt...
Shell
#!/bin/sh /etc/rc.common START=59 EXTRA_COMMANDS="status checkrunning radconfig condrestart" EXTRA_HELP=" status Show current status checkrunning If services is not running start it" PATH=/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/sbin/chilli NAME=chilli DESC=chilli CONFFILE=/etc/chilli.conf OPTS="--pidfile /var/r...
Shell
#!/bin/sh /etc/rc.common START=59 EXTRA_COMMANDS="status checkrunning radconfig condrestart" EXTRA_HELP=" status Show current status checkrunning If services is not running start it" PATH=/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/sbin/chilli NAME=chilli DESC=chilli CONFFILE=/etc/chilli.conf OPTS="--pidfile /var/r...
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 # # Webif post-install script. # if [ "`grep "IW" "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"`" = "" ]; then echo "##WEBIF:category:IW" >> ${IPKG_INSTROOT}/www/cgi-bin/webif/.categories fi echo " #### Chilli firewall configuration CHILLI="tun0" iptables -A INPUT -p tcp -m tcp --dport 3990 --syn -j ACC...
Shell
#!/bin/sh # # IW-chillispot post-removal script. # # sed -e '/##WEBIF:category:HotSpot/d' -i ${IPKG_INSTROOT}/www/cgi-bin/webif/.categories 2>/dev/null sed -e '/#### Chilli firewall configuration/,/#### Chilli end/ d' /etc/firewall.user | cat > /etc/firewall.user
Shell
#!/bin/sh # # IW-chillispot post-removal script. # # sed -e '/##WEBIF:category:HotSpot/d' -i ${IPKG_INSTROOT}/www/cgi-bin/webif/.categories 2>/dev/null sed -e '/#### Chilli firewall configuration/,/#### Chilli end/ d' /etc/firewall.user | cat > /etc/firewall.user
Shell
#!/bin/sh # # Webif post-install script. # if [ "`grep "IW" "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"`" = "" ]; then echo "##WEBIF:category:IW" >> ${IPKG_INSTROOT}/www/cgi-bin/webif/.categories fi echo " #### Chilli firewall configuration CHILLI="tun0" iptables -A INPUT -p tcp -m tcp --dport 3990 --syn -j ACC...
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=59 EXTRA_COMMANDS="status checkrunning radconfig condrestart" EXTRA_HELP=" status Show current status checkrunning If services is not running start it" PATH=/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/sbin/chilli NAME=chilli DESC=chilli CONFFILE=/etc/chilli.conf OPTS="--pidfile /var/r...
Shell
#!/bin/sh /etc/rc.common START=59 EXTRA_COMMANDS="status checkrunning radconfig condrestart" EXTRA_HELP=" status Show current status checkrunning If services is not running start it" PATH=/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/sbin/chilli NAME=chilli DESC=chilli CONFFILE=/etc/chilli.conf OPTS="--pidfile /var/r...
Shell
#!/bin/sh #[ -f ${IPKG_INSTROOT}/etc/chilli/defaults ] && { # ln -s /etc/chilli/www/chilliController.js ${IPKG_INSTROOT}/www/js # ln -s /etc/chilli/www/ChilliLibrary.js ${IPKG_INSTROOT}/www/js # ln -s /etc/chilli/www/wait.gif ${IPKG_INSTROOT}/www/images # ln -s /etc/chilli/www/openid.gif ${IPKG_INSTROOT}/www/images # m...
Shell
#!/bin/sh #[ -f ${IPKG_INSTROOT}/etc/chilli/defaults ] && { # ln -s /etc/chilli/www/chilliController.js ${IPKG_INSTROOT}/www/js # ln -s /etc/chilli/www/ChilliLibrary.js ${IPKG_INSTROOT}/www/js # ln -s /etc/chilli/www/wait.gif ${IPKG_INSTROOT}/www/images # ln -s /etc/chilli/www/openid.gif ${IPKG_INSTROOT}/www/images # m...
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 # 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