code
stringlengths
1
1.96M
language
stringclasses
1 value
#!/bin/sh # # base-files-uci post-install script. # # for squashfs symlink hacks like in WR RC5 (requires rm before change) FixReadOnlyLink() { touch "$1" >&- 2>&- # test if read-only [ "$?" != 0 ] && { local tmpfile=$(mktemp "${IPKG_INSTROOT}/tmp/.webif-inst-XXXXXX") cp -p "$1" "$tmpfile" >&- 2>&- rm "$1" >&...
Shell
#!/bin/sh mv "${IPKG_INSTROOT}/bin/ipkg" "${IPKG_INSTROOT}/bin/.ipkg"
Shell
#!/bin/sh mv "${IPKG_INSTROOT}/bin/ipkg" "${IPKG_INSTROOT}/bin/.ipkg"
Shell
#!/bin/sh DEFAULT=/etc/default/xinetd RUN_D=/var/run PID_F=$RUN_D/xinetd.pid [ -f $DEFAULT ] && . $DEFAULT case $1 in start) [ -d $RUN_D ] || mkdir -p $RUN_D xinetd $OPTIONS ;; stop) [ -f $PID_F ] && kill $(cat $PID_F) ;; *) echo "usage: $0 (start|stop)" exit 1 esac exit $?
Shell
#!/bin/sh DEFAULT=/etc/default/xinetd RUN_D=/var/run PID_F=$RUN_D/xinetd.pid [ -f $DEFAULT ] && . $DEFAULT case $1 in start) [ -d $RUN_D ] || mkdir -p $RUN_D xinetd $OPTIONS ;; stop) [ -f $PID_F ] && kill $(cat $PID_F) ;; *) echo "usage: $0 (start|stop)" exit 1 esac exit $?
Shell
#!/bin/sh if [ $# -lt 1 ]; then echo "Usage: $0 USERNAME" exit 1 fi export SCP_USER="$1" rm bin/packages/w?bf??e* chmod -R 775 bin/* chmod 775 build_mipsel/webif-0.3/ipkg/webif/www/.version echo "Uploading webif ..." scp \ bin/packages/web* \ $SCP_USER@shell.berlios.de:/home/groups/ftp/pub/xwrt/packages/ echo "Uplo...
Shell
#!/bin/sh # use the image builder to make X-Wrt images. echo "Making firmware images ..." rm -rf imgbuild mkdir -p ./imgbuild cd imgbuild tar -xjf ../bin/OpenWrt-ImageBuilder-Linux-i686.tar.bz2 cd OpenWrt-ImageBuilder-Linux-i686 make cd ../..
Shell
#!/bin/sh # compress all images into a single small archive. # requires tar before compress so all data is in single stream. CompressDir() { odir=$(pwd) cd "$1" rm -f xwrt*.tar rm -f xwrt*.rar.tar tar -cvf xwrt-squashfs-images.tar *squashfs*.bin *squashfs*.trx #tar -cvf xwrt-jffs-images.tar *jffs*.bin *jffs*.trx 7z a ...
Shell
#!/bin/sh ./cleanw.sh && make && ./mkimages.sh && ./compress_images.sh && ./upload_files.sh jcollake
Shell
#!/bin/sh rm -rf build_mipsel/webif* rm -rf build_mipsel/base-files*
Shell
#!/bin/bash # flash script for linksys and asus routers # # Copyright (C) 2004 by Oleg I. Vdovikin <oleg@cs.msu.su> # Copyright (C) 2005 by Waldemar Brodkorb <wbx@dass-it.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by...
Shell
#! /bin/sh # A little script I whipped up to make it easy to # patch source trees and have sane error handling # -Erik # # (c) 2002 Erik Andersen <andersen@codepoet.org> # Set directories from arguments, or use defaults. targetdir=${1-.} patchdir=${2-../kernel-patches} patchpattern=${3-*} if [ ! -d "${targetdir}" ] ;...
Shell
#!/bin/bash BASE=http://svn.openwrt.org/openwrt/branches/whiterussian/openwrt TARGET=$1 CONTROL=$2 VERSION=$3 ARCH=$4 WD=$(pwd) mkdir -p "$TARGET/CONTROL" grep '^[^(Version|Architecture)]' "$CONTROL" > "$TARGET/CONTROL/control" grep '^Maintainer' "$CONTROL" 2>&1 >/dev/null || \ echo "Maintainer: OpenWrt Devel...
Shell
#!/bin/sh # ipkg - the itsy package management system # # Copyright (C) 2001 Carl D. Worth # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later ver...
Shell
#! /bin/sh # A little script I whipped up to make it easy to # patch source trees and have sane error handling # -Erik # # (c) 2002 Erik Andersen <andersen@codepoet.org> # Set directories from arguments, or use defaults. targetdir=${1-.} patchdir=${2-../kernel-patches} patchpattern=${3-*} if [ ! -d "${targetdir}" ] ;...
Shell
#!/bin/bash BASE=http://svn.openwrt.org/openwrt/branches/whiterussian/openwrt TARGET=$1 CONTROL=$2 VERSION=$3 ARCH=$4 WD=$(pwd) mkdir -p "$TARGET/CONTROL" grep '^[^(Version|Architecture)]' "$CONTROL" > "$TARGET/CONTROL/control" grep '^Maintainer' "$CONTROL" 2>&1 >/dev/null || \ echo "Maintainer: OpenWrt Devel...
Shell
#!/bin/sh # ipkg - the itsy package management system # # Copyright (C) 2001 Carl D. Worth # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later ver...
Shell
#!/bin/sh SELF=${0##*/} [ -z "$STRIP" ] && { echo "$SELF: strip command not defined (STRIP variable not set)" exit 1 } TARGETS=$* [ -z "$TARGETS" ] && { echo "$SELF: no directories / files specified" echo "usage: $SELF [PATH...]" exit 1 } find $TARGETS -type f -a -exec file {} \; | \ sed -n -e 's/^\(.*...
Shell
#!/bin/bash # flash script for linksys and asus routers # # Copyright (C) 2004 by Oleg I. Vdovikin <oleg@cs.msu.su> # Copyright (C) 2005 by Waldemar Brodkorb <wbx@dass-it.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by...
Shell
#!/bin/sh SELF=${0##*/} [ -z "$STRIP" ] && { echo "$SELF: strip command not defined (STRIP variable not set)" exit 1 } TARGETS=$* [ -z "$TARGETS" ] && { echo "$SELF: no directories / files specified" echo "usage: $SELF [PATH...]" exit 1 } find $TARGETS -type f -a -exec file {} \; | \ sed -n -e 's/^\(.*...
Shell
#!/bin/sh if [ -x /usr/bin/sed ]; then SED="/usr/bin/sed"; else if [ -x /bin/sed ]; then SED="/bin/sed"; fi; fi; echo "HELLO" > .sedtest $SED -i -e "s/HELLO/GOODBYE/" .sedtest >/dev/null 2>&1 if [ $? != 0 ] ; then echo build-sed-host-binary else echo use-sed-host-binary fi; rm -f .sedtest
Shell
#!/bin/sh if [ -x /usr/bin/sed ]; then SED="/usr/bin/sed"; else if [ -x /bin/sed ]; then SED="/bin/sed"; fi; fi; echo "HELLO" > .sedtest $SED -i -e "s/HELLO/GOODBYE/" .sedtest >/dev/null 2>&1 if [ $? != 0 ] ; then echo build-sed-host-binary else echo use-sed-host-binary fi; rm -f .sedtest
Shell
#!/bin/sh if [ -z "$STAGING_DIR" ]; then STAGING_DIR="${0%/*}" STAGING_DIR="${STAGING_DIR%/usr/bin*}" fi PKG_CONFIG_REAL="${STAGING_DIR}/usr/bin/pkg-config.real" if [ -z "$PKG_CONFIG_PATH" ]; then export PKG_CONFIG_PATH="${STAGING_DIR}/usr/lib/pkgconfig" fi if [ -z "$PKG_CONFIG_LIBDIR" ]; then export PKG_CONFIG_LIB...
Shell
#!/bin/sh if [ -z "$STAGING_DIR" ]; then STAGING_DIR="${0%/*}" STAGING_DIR="${STAGING_DIR%/usr/bin*}" fi PKG_CONFIG_REAL="${STAGING_DIR}/usr/bin/pkg-config.real" if [ -z "$PKG_CONFIG_PATH" ]; then export PKG_CONFIG_PATH="${STAGING_DIR}/usr/lib/pkgconfig" fi if [ -z "$PKG_CONFIG_LIBDIR" ]; then export PKG_CONFIG_LIB...
Shell
#!/bin/sh -e ## 001_ld_makefile_patch.dpatch ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Description: correct where ld scripts are installed ## DP: Author: Chris Chimelis <chris@debian.org> ## DP: Upstream status: N/A ## DP: Date: ?? if [ $# -ne 1 ]; then echo >&2 "`basename $0`:...
Shell
#!/bin/sh -e ## 012_check_ldrunpath_length.dpatch by Chris Chimelis <chris@debian.org> ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Only generate an RPATH entry if LD_RUN_PATH is not empty, for ## DP: cases where -rpath isn't specified. (#151024) if [ $# -ne 1 ]; then echo >&2 "`b...
Shell
#!/bin/sh -e ## 012_check_ldrunpath_length.dpatch by Chris Chimelis <chris@debian.org> ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Only generate an RPATH entry if LD_RUN_PATH is not empty, for ## DP: cases where -rpath isn't specified. (#151024) if [ $# -ne 1 ]; then echo >&2 "`b...
Shell
#!/bin/sh -e ## 001_ld_makefile_patch.dpatch ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Description: correct where ld scripts are installed ## DP: Author: Chris Chimelis <chris@debian.org> ## DP: Upstream status: N/A ## DP: Date: ?? if [ $# -ne 1 ]; then echo >&2 "`basename $0`:...
Shell
#!/bin/sh -e ## 006_better_file_error.dpatch by David Kimdon <dwhedon@gordian.com> ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Specify which filename is causing an error if the filename is a ## DP: directory. (#45832) if [ $# -ne 1 ]; then echo >&2 "`basename $0`: script expects ...
Shell
#!/bin/sh -e ## 006_better_file_error.dpatch by David Kimdon <dwhedon@gordian.com> ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Specify which filename is causing an error if the filename is a ## DP: directory. (#45832) if [ $# -ne 1 ]; then echo >&2 "`basename $0`: script expects ...
Shell
#!/bin/sh -e ## 001_ld_makefile_patch.dpatch ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Description: correct where ld scripts are installed ## DP: Author: Chris Chimelis <chris@debian.org> ## DP: Upstream status: N/A ## DP: Date: ?? if [ $# -ne 1 ]; then echo >&2 "`basename $0`:...
Shell
#!/bin/sh -e ## 012_check_ldrunpath_length.dpatch by Chris Chimelis <chris@debian.org> ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Only generate an RPATH entry if LD_RUN_PATH is not empty, for ## DP: cases where -rpath isn't specified. (#151024) if [ $# -ne 1 ]; then echo >&2 "`b...
Shell
#! /bin/sh -e ## 120_mips_xgot_multigot_workaround.dpatch ## ## DP: Description: Make multigot/xgot handling mutually exclusive. ## DP: Author: Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> ## DP: Upstream status: Not submitted ## DP: Date: 2004-09-17 if [ $# -lt 1 ]; then echo "`basename $0`: script expects -pa...
Shell
#!/bin/sh -e ## 012_check_ldrunpath_length.dpatch by Chris Chimelis <chris@debian.org> ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Only generate an RPATH entry if LD_RUN_PATH is not empty, for ## DP: cases where -rpath isn't specified. (#151024) if [ $# -ne 1 ]; then echo >&2 "`b...
Shell
#!/bin/sh -e ## 001_ld_makefile_patch.dpatch ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Description: correct where ld scripts are installed ## DP: Author: Chris Chimelis <chris@debian.org> ## DP: Upstream status: N/A ## DP: Date: ?? if [ $# -ne 1 ]; then echo >&2 "`basename $0`:...
Shell
#!/bin/sh -e ## 006_better_file_error.dpatch by David Kimdon <dwhedon@gordian.com> ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Specify which filename is causing an error if the filename is a ## DP: directory. (#45832) if [ $# -ne 1 ]; then echo >&2 "`basename $0`: script expects ...
Shell
#! /bin/sh -e ## 120_mips_xgot_multigot_workaround.dpatch ## ## DP: Description: Make multigot/xgot handling mutually exclusive. ## DP: Author: Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> ## DP: Upstream status: Not submitted ## DP: Date: 2004-09-17 if [ $# -lt 1 ]; then echo "`basename $0`: script expects -pa...
Shell
#!/bin/sh -e ## 006_better_file_error.dpatch by David Kimdon <dwhedon@gordian.com> ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Specify which filename is causing an error if the filename is a ## DP: directory. (#45832) if [ $# -ne 1 ]; then echo >&2 "`basename $0`: script expects ...
Shell
#!/bin/sh -e ## 001_ld_makefile_patch.dpatch ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Description: correct where ld scripts are installed ## DP: Author: Chris Chimelis <chris@debian.org> ## DP: Upstream status: N/A ## DP: Date: ?? if [ $# -ne 1 ]; then echo >&2 "`basename $0`:...
Shell
#!/bin/sh -e ## 012_check_ldrunpath_length.dpatch by Chris Chimelis <chris@debian.org> ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Only generate an RPATH entry if LD_RUN_PATH is not empty, for ## DP: cases where -rpath isn't specified. (#151024) if [ $# -ne 1 ]; then echo >&2 "`b...
Shell
#! /bin/sh -e ## 120_mips_xgot_multigot_workaround.dpatch ## ## DP: Description: Make multigot/xgot handling mutually exclusive. ## DP: Author: Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> ## DP: Upstream status: Not submitted ## DP: Date: 2004-09-17 if [ $# -lt 1 ]; then echo "`basename $0`: script expects -pa...
Shell
#!/bin/sh -e ## 012_check_ldrunpath_length.dpatch by Chris Chimelis <chris@debian.org> ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Only generate an RPATH entry if LD_RUN_PATH is not empty, for ## DP: cases where -rpath isn't specified. (#151024) if [ $# -ne 1 ]; then echo >&2 "`b...
Shell
#!/bin/sh -e ## 001_ld_makefile_patch.dpatch ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Description: correct where ld scripts are installed ## DP: Author: Chris Chimelis <chris@debian.org> ## DP: Upstream status: N/A ## DP: Date: ?? if [ $# -ne 1 ]; then echo >&2 "`basename $0`:...
Shell
#!/bin/sh -e ## 006_better_file_error.dpatch by David Kimdon <dwhedon@gordian.com> ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Specify which filename is causing an error if the filename is a ## DP: directory. (#45832) if [ $# -ne 1 ]; then echo >&2 "`basename $0`: script expects ...
Shell
#! /bin/sh -e ## 120_mips_xgot_multigot_workaround.dpatch ## ## DP: Description: Make multigot/xgot handling mutually exclusive. ## DP: Author: Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> ## DP: Upstream status: Not submitted ## DP: Date: 2004-09-17 if [ $# -lt 1 ]; then echo "`basename $0`: script expects -pa...
Shell
#!/bin/sh -e ## 006_better_file_error.dpatch by David Kimdon <dwhedon@gordian.com> ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Specify which filename is causing an error if the filename is a ## DP: directory. (#45832) if [ $# -ne 1 ]; then echo >&2 "`basename $0`: script expects ...
Shell
#!/bin/sh ./cleanw.sh && make && ./mkimages.sh && ./compress_images.sh && ./upload_files.sh jcollake
Shell
#!/bin/sh if [ $# -lt 1 ]; then echo "Usage: $0 USERNAME" exit 1 fi export SCP_USER="$1" rm bin/packages/w?bf??e* chmod -R 775 bin/* chmod 775 build_mipsel/webif-0.3/ipkg/webif/www/.version echo "Uploading webif ..." scp \ bin/packages/web* \ $SCP_USER@shell.berlios.de:/home/groups/ftp/pub/xwrt/packages/ echo "Uplo...
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> . /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 . /etc/functions.sh uci_get() { uci -P /var/state get "$1" 2>/dev/null } export ENTITY=$1 HOST=$2 export KEY_SIZE=$(uci_get "openssl.$ENTITY.CA_default_bits") export KEY_EXPIRE=$(uci_get "openssl.$ENTITY.CA_default_days") export KEY_CRLDAYS=$(uci_get "openssl.$ENTITY.CA_default_crldays") export KEY_MD=$(uc...
Shell
#!/bin/sh . /etc/openssl/read_uci #openssl req -new -batch \ openssl req -new -nodes -batch \ -keyout /etc/openssl/$ENTITY/private/$KEY_COMMON_NAME.key \ -out /etc/openssl/$ENTITY/csr/$KEY_COMMON_NAME.csr \ -config /etc/openssl/openssl.cnf #openssl ca -batch -passout $KEY_PASSWD \ openssl ca -batch \ -out /etc/ope...
Shell
#!/bin/sh . /etc/openssl/read_uci #openssl req -days 3650 -batch \ openssl req -days 3650 -nodes -batch \ -new -x509 \ -keyout /etc/openssl/$ENTITY/topsecret/cakey.pem \ -out /etc/openssl/$ENTITY/cacert.crt \ -config /etc/openssl/openssl.cnf
Shell
#!/bin/sh . /etc/functions.sh uci_get() { uci -P /var/state get "$1" 2>/dev/null } export ENTITY=$1 HOST=$2 export KEY_SIZE=$(uci_get "openssl.$ENTITY.CA_default_bits") export KEY_EXPIRE=$(uci_get "openssl.$ENTITY.CA_default_days") export KEY_CRLDAYS=$(uci_get "openssl.$ENTITY.CA_default_crldays") export KEY_MD=$(uc...
Shell
#!/bin/sh openssl dhparam -out /etc/openssl/testingfof/dh.pem 1024 ##openvpn --genkey --secret ta.key
Shell
#!/bin/sh . /etc/openssl/read_uci openssl ca -revoke /etc/openssl/$ENTITY/certs/$KEY_COMMON_NAME.crt -config /etc/openssl/openssl.cnf openssl ca -gencrl -out /etc/openssl/$ENTITY/crl/crl.pem -config /etc/openssl/openssl.cnf
Shell
#!/bin/sh . /etc/openssl/read_uci #openssl req -days 3650 -batch \ openssl req -days 3650 -nodes -batch \ -new -x509 \ -keyout /etc/openssl/$ENTITY/topsecret/cakey.pem \ -out /etc/openssl/$ENTITY/cacert.crt \ -config /etc/openssl/openssl.cnf
Shell
#!/bin/sh . /etc/openssl/read_uci #openssl req -new -batch \ openssl req -new -nodes -batch \ -keyout /etc/openssl/$ENTITY/private/$KEY_COMMON_NAME.key \ -out /etc/openssl/$ENTITY/csr/$KEY_COMMON_NAME.csr \ -config /etc/openssl/openssl.cnf #openssl ca -batch -passout $KEY_PASSWD \ openssl ca -batch \ -out /etc/ope...
Shell
#!/bin/sh . /etc/openssl/read_uci openssl ca -revoke /etc/openssl/$ENTITY/certs/$KEY_COMMON_NAME.crt -config /etc/openssl/openssl.cnf openssl ca -gencrl -out /etc/openssl/$ENTITY/crl/crl.pem -config /etc/openssl/openssl.cnf
Shell
#!/bin/sh openssl dhparam -out /etc/openssl/testingfof/dh.pem 1024 ##openvpn --genkey --secret ta.key
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=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