code stringlengths 1 1.96M | language stringclasses 1
value |
|---|---|
#!/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
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
timestamp='2005-04-22'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU Gene... | Shell |
#!/bin/sh
set -e
pkg_dir=$1
if [ -z $pkg_dir ] || [ ! -d $pkg_dir ]; then
echo "Usage: ipkg-make-index <package_directory>"
exit 1
fi
which md5sum 2>&1 >/dev/null || alias md5sum=md5
for pkg in `find $pkg_dir -name '*.ipk' | sort`; do
echo "Generating index for package $pkg" >&2
file_size=$(ls -l $pkg | awk '{p... | 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/sh
BASE=http://svn.openwrt.org/openwrt/trunk/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 Developers Team <openwr... | 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 |
#!/usr/bin/env bash
#
# Copyright (C) 2006 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
find_modparams() {
FILE="$1"
$NM "$FILE" | awk '
BEGIN {
FS=" "
}
($3 ~ /^__module_parm_/) && ($3 !~ /^__module_parm_desc/) {
gsub(/__module_pa... | Shell |
#!/usr/bin/env bash
#
# Copyright (C) 2006 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
find_modparams() {
FILE="$1"
$NM "$FILE" | awk '
BEGIN {
FS=" "
}
($3 ~ /^__module_parm_/) && ($3 !~ /^__module_parm_desc/) {
gsub(/__module_pa... | Shell |
#!/bin/sh
[ ! -f /etc/dropbear/dropbear_rsa_host_key ] && {
for type in rsa dss; do {
# check for keys
key=/tmp/dropbear/dropbear_${type}_host_key
[ ! -f $key ] && {
# generate missing keys
mkdir -p /tmp/dropbear
[ -x /usr/bin/dropbearkey ] && {
/usr/bin/dropbearkey -t $type -f $key 2>&- >&- && exe... | Shell |
#!/bin/sh
[ ! -f /etc/dropbear/dropbear_rsa_host_key ] && {
for type in rsa dss; do {
# check for keys
key=/tmp/dropbear/dropbear_${type}_host_key
[ ! -f $key ] && {
# generate missing keys
mkdir -p /tmp/dropbear
[ -x /usr/bin/dropbearkey ] && {
/usr/bin/dropbearkey -t $type -f $key 2>&- >&- && exe... | Shell |
#!/bin/sh
[ "$ACTION" = "ifup" ] && [ "$INTERFACE" = "wan" ] && /etc/init.d/S??miniupnpd start 2>/dev/null
| Shell |
#!/bin/sh
[ "$ACTION" = "ifup" ] && [ "$INTERFACE" = "wan" ] && /etc/init.d/S??miniupnpd start 2>/dev/null
| Shell |
#!/bin/sh /etc/rc.common
START=95
RUN_D=/var/run
PID_F=$RUN_D/miniupnpd.pid
CTL_F=$RUN_D/miniupnpd.ctl
append_bool() {
local section="$1"
local option="$2"
local value="$3"
local default="${4:-0}"
local _loctmp
config_get_bool _loctmp "$section" "$option" "$default"
[ "$_loctmp" -gt 0 ] && append args "$3"
}
... | Shell |
#!/bin/sh /etc/rc.common
START=95
RUN_D=/var/run
PID_F=$RUN_D/miniupnpd.pid
CTL_F=$RUN_D/miniupnpd.ctl
append_bool() {
local section="$1"
local option="$2"
local value="$3"
local default="${4:-0}"
local _loctmp
config_get_bool _loctmp "$section" "$option" "$default"
[ "$_loctmp" -gt 0 ] && append args "$3"
}
... | Shell |
#!/bin/sh
| Shell |
#!/bin/sh
tar -cf "${IPKG_INSTROOT}/rom/local.tar" --owner=root --group=root "${IPKG_INSTROOT}/etc"
mkdir -p "${IPKG_INSTROOT}/tmp/local/etc"
chmod 0755 "${IPKG_INSTROOT}/tmp/local"
chmod 0755 "${IPKG_INSTROOT}/tmp/local/etc"
mv "${IPKG_INSTROOT}/etc/preinit" "${IPKG_INSTROOT}/tmp/local/etc/preinit"
mv "${IPKG_INSTROOT... | Shell |
#!/bin/sh
tar -cf "${IPKG_INSTROOT}/rom/local.tar" --owner=root --group=root "${IPKG_INSTROOT}/etc"
mkdir -p "${IPKG_INSTROOT}/tmp/local/etc"
chmod 0755 "${IPKG_INSTROOT}/tmp/local"
chmod 0755 "${IPKG_INSTROOT}/tmp/local/etc"
mv "${IPKG_INSTROOT}/etc/preinit" "${IPKG_INSTROOT}/tmp/local/etc/preinit"
mv "${IPKG_INSTROOT... | Shell |
#!/bin/sh
| 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
#
# 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-",""); print "option|"$1"|"$5}' | sort | uniq >> "$tmpthemeslst"
if [ "'cat $tmpthemeslst'" != "" ]; then
if [ "'cat $tmpthemeslst'" != "'cat $themes_lst'" ]; then
rm -f "$themes_lst"... | Shell |
#!/bin/ash
#
#
# Handler for config application of all types.
#
# Types supported:
# config-* Simple config files (tuples)
# uci-* UCI config files
# file-* Undefined format for whatever
# edited-files-* raw edited files
#
#
. /usr/lib/webif/functions.sh
. /lib/config/uci.sh
cron_init="/etc/init.d/S60cron"
# log ... | Shell |
#!/bin/sh
themes_lst="/etc/themes.lst"
tmpthemeslst=$(mktemp "/tmp/.webif-XXXXXX")
ipkg list | awk '/webif-theme/ { gsub("webif-theme-",""); print "option|"$1"|"$5}' | sort | uniq >> "$tmpthemeslst"
if [ "'cat $tmpthemeslst'" != "" ]; then
if [ "'cat $tmpthemeslst'" != "'cat $themes_lst'" ]; then
rm -f "$themes_lst"... | 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
# rebuild the language list only after ipkg update
for listfile in $(ls /usr/lib/ipkg/lists/* 2>/dev/null); do
[ "$listf... | Shell |
#!/bin/ash
#
#
# Handler for config application of all types.
#
# Types supported:
# config-* Simple config files (tuples)
# uci-* UCI config files
# file-* Undefined format for whatever
# edited-files-* raw edited files
#
#
. /usr/lib/webif/functions.sh
. /lib/config/uci.sh
cron_init="/etc/init.d/S60cron"
# log ... | 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
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
# rebuild the language list only after ipkg update
for listfile in $(ls /usr/lib/ipkg/lists/* 2>/dev/null); do
[ "$listf... | 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:
#
# NVRAM variables referenced:
#
# Configuration ... | 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
[ "$INTERFACE" = "wan" ] && {
case "$ACTION" in
ifdown) [ -e /tmp/.wan_timestamp ] && rm -f /tmp/.wan_timestamp 2>/dev/null ;;
ifup) wan_timestamp=$(date "+%s" 2>/dev/null)
[ "$wan_timestamp" -gt 1000000000 ] && {
[ ! -d /tmp ] && mkdir -p /tmp 2>/dev/null
echo "$wan_timestamp" > /tmp/.wan_tim... | Shell |
#!/bin/sh
[ "$INTERFACE" = "wan" -a -x /etc/init.d/S??opendns ] && {
case "$ACTION" in
ifup) /etc/init.d/S??opendns enable ;;
ifdown) /etc/init.d/S??opendns disable ;;
esac
}
| Shell |
#!/bin/sh
[ "$INTERFACE" = "wan" ] && [ "$(nvram get ddns_enable)" = "1" ] && {
. /etc/functions.sh
ezipupdate_name="ez-ipupdate"
ezipupdate_bin="/usr/sbin/$ezipupdate_name"
ezipupdate_init="/etc/init.d/S??$ezipupdate_name"
ddns_dir="/etc/$ezipupdate_name"
ddns_conf="$ddns_dir/${ezipupdate_name}.conf"
ddns_cach... | Shell |
#!/bin/sh
[ "$INTERFACE" = "wan" ] && {
case "$ACTION" in
ifdown) [ -e /tmp/.wan_timestamp ] && rm -f /tmp/.wan_timestamp 2>/dev/null ;;
ifup) wan_timestamp=$(date "+%s" 2>/dev/null)
[ "$wan_timestamp" -gt 1000000000 ] && {
[ ! -d /tmp ] && mkdir -p /tmp 2>/dev/null
echo "$wan_timestamp" > /tmp/.wan_tim... | Shell |
#!/bin/sh
[ "$INTERFACE" = "wan" ] && [ "$(nvram get ddns_enable)" = "1" ] && {
. /etc/functions.sh
ezipupdate_name="ez-ipupdate"
ezipupdate_bin="/usr/sbin/$ezipupdate_name"
ezipupdate_init="/etc/init.d/S??$ezipupdate_name"
ddns_dir="/etc/$ezipupdate_name"
ddns_conf="$ddns_dir/${ezipupdate_name}.conf"
ddns_cach... | Shell |
#!/bin/sh
[ "$INTERFACE" = "wan" -a -x /etc/init.d/S??opendns ] && {
case "$ACTION" in
ifup) /etc/init.d/S??opendns enable ;;
ifdown) /etc/init.d/S??opendns disable ;;
esac
}
| 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
#
# script called after a sucessful ip update
#
RUN_D=/var/run
PID_F=$RUN_D/ez-ipupdate.pid
ddns_dir="/etc/ez-ipupdate"
ddns_cache="$ddns_dir/ez-ipupdate.cache"
ddns_msg="$ddns_dir/ez-ipupdate.msg"
echo -n "OK. Successful update to $1 at: " > $ddns_msg
date >> $ddns_msg
| Shell |
#!/bin/sh
#
# script called after a sucessful ip update
#
RUN_D=/var/run
PID_F=$RUN_D/ez-ipupdate.pid
ddns_dir="/etc/ez-ipupdate"
ddns_cache="$ddns_dir/ez-ipupdate.cache"
ddns_msg="$ddns_dir/ez-ipupdate.msg"
echo -n "OK. Successful update to $1 at: " > $ddns_msg
date >> $ddns_msg
| Shell |
#!/bin/sh
#
# crond Starts crond
#
# crontabs are here
etc_crontabs="/etc/crontabs"
crond_temp="/var/spool/cron"
# sure it exists
mkdir -p "$etc_crontabs"
mkdir -p "$crond_temp"
getPID(){
echo `ps | grep '[/]usr/sbin/crond' | awk '{ print $1 }'`
}
start() {
if [ "$(nvram get cron_enable)" = "1" ]; then
... | Shell |
#!/bin/sh
# a basic device/firmware detection script
START=90
. /etc/functions.sh
. /lib/config/uci.sh
uci_load "webif"
device_name="$CONFIG_general_device_name"
firmware_name="$CONFIG_general_firmware_name"
firmware_subtitle="$CONFIG_general_firmware_subtitle"
firmware_version="$CONFIG_general_firmware_version"
commi... | Shell |
#!/bin/sh
. /etc/ppp/functions.sh
getpid() { echo -n $(ps|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>&- >&-
do... | Shell |
#!/bin/sh
# configure opendns nameservers if enabled
. /usr/lib/webif/functions.sh
get_working_resolv() {
working_resolv=$(cat /etc/dnsmasq.conf 2>/dev/null | sed '/^resolv-file=/!d; s/^resolv-file=//; s/^[[:space:]]*//; s/[[:space:]]$//')
working_resolv="${working_resolv:-/tmp/resolv.conf.auto}"
}
enable() {
loca... | 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 get ifn... | Shell |
#!/bin/sh
#
# ez-ipupdate Starts ez-ipupdate
#
ezipupdate_name="ez-ipupdate"
ezipupdate_bin="/usr/sbin/$ezipupdate_name"
ezipupdate_pid="/var/run/${ezipupdate_name}.pid"
ddns_dir="/etc/$ezipupdate_name"
ddns_conf="$ddns_dir/${ezipupdate_name}.conf"
ddns_cache="$ddns_dir/${ezipupdate_name}.cache"
ddns_exec_ok="$ddn... | Shell |
#!/bin/sh
# Copyright (C) 2007 X-Wrt.org
START=01
. /etc/syslog.default
syslogd_bin="/sbin/syslogd"
dmesg_bin="/bin/dmesg"
klogd_bin="/sbin/klogd"
start() {
[ -n "$(ps | grep [s]yslogd)" -o -n "$(ps | grep [k]logd)" ] && stop
#log_mark=$(nvram get log_mark)
#[ "$log_mark" -gt 0 ] 2>>/dev/null || log_mark=$DEFAULT... | Shell |
#!/bin/sh
# Copyright (C) 2007 X-Wrt.org
START=99
start() {
. /etc/syslog.default
klog_enabled=$(nvram get klog_enabled)
klog_enabled=${klog_enabled:-$DEFAULT_klog_enabled}
[ "$klog_enabled" = "1" ] && {
klog_file=$(nvram get klog_file)
klog_file=${klog_file:-$DEFAULT_klog_file}
klog_buffersize=$(nvram get k... | Shell |
#!/bin/sh
# a basic device/firmware detection script
START=90
. /etc/functions.sh
. /lib/config/uci.sh
uci_load "webif"
device_name="$CONFIG_general_device_name"
firmware_name="$CONFIG_general_firmware_name"
firmware_subtitle="$CONFIG_general_firmware_subtitle"
firmware_version="$CONFIG_general_firmware_version"
commi... | Shell |
#!/bin/sh
#
# crond Starts crond
#
# crontabs are here
etc_crontabs="/etc/crontabs"
crond_temp="/var/spool/cron"
# sure it exists
mkdir -p "$etc_crontabs"
mkdir -p "$crond_temp"
getPID(){
echo `ps | grep '[/]usr/sbin/crond' | awk '{ print $1 }'`
}
start() {
if [ "$(nvram get cron_enable)" = "1" ]; then
... | Shell |
#!/bin/sh
# configure opendns nameservers if enabled
. /usr/lib/webif/functions.sh
get_working_resolv() {
working_resolv=$(cat /etc/dnsmasq.conf 2>/dev/null | sed '/^resolv-file=/!d; s/^resolv-file=//; s/^[[:space:]]*//; s/[[:space:]]$//')
working_resolv="${working_resolv:-/tmp/resolv.conf.auto}"
}
enable() {
loca... | Shell |
#!/bin/sh
# create symlink to /tmp/TZ if /etc/TZ doesn't exist
# todo: -e | -f | -d didn't seem to work here, so I used find
if [ -z $(find "/etc/TZ" 2>/dev/null) ]; then
ln -s /tmp/TZ /etc/TZ
fi
# eJunky: set timezone
TZ=$(nvram get time_zone | cut -f 2)
TZ="${TZ:-UTC+0}"
echo $TZ > /etc/TZ
| 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 get ifn... | Shell |
#!/bin/sh
# Copyright (C) 2007 X-Wrt.org
. /etc/functions.sh
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"
D... | Shell |
#!/bin/sh
status="0"
file_check() {
for file in "$@"; do
if [ ! -f "$file" ]; then
logger -s "$0: Missing $file. Please generate and try again."
status="1"
fi
done
}
case "$1" in
start)
case "$(nvram get openvpn_cli)" in
on|enabled|1)
continue ;;
off|disabled|0)
exit 0 ;;
esac
SERVER=... | Shell |
#!/bin/sh
# Copyright (C) 2007 X-Wrt.org
START=01
. /etc/syslog.default
syslogd_bin="/sbin/syslogd"
dmesg_bin="/bin/dmesg"
klogd_bin="/sbin/klogd"
start() {
[ -n "$(ps | grep [s]yslogd)" -o -n "$(ps | grep [k]logd)" ] && stop
#log_mark=$(nvram get log_mark)
#[ "$log_mark" -gt 0 ] 2>>/dev/null || log_mark=$DEFAULT... | Shell |
#!/bin/sh
. /etc/ppp/functions.sh
getpid() { echo -n $(ps|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>&- >&-
do... | Shell |
#!/bin/sh
#
# ez-ipupdate Starts ez-ipupdate
#
ezipupdate_name="ez-ipupdate"
ezipupdate_bin="/usr/sbin/$ezipupdate_name"
ezipupdate_pid="/var/run/${ezipupdate_name}.pid"
ddns_dir="/etc/$ezipupdate_name"
ddns_conf="$ddns_dir/${ezipupdate_name}.conf"
ddns_cache="$ddns_dir/${ezipupdate_name}.cache"
ddns_exec_ok="$ddn... | Shell |
#!/bin/sh
# Copyright (C) 2007 X-Wrt.org
START=99
start() {
. /etc/syslog.default
klog_enabled=$(nvram get klog_enabled)
klog_enabled=${klog_enabled:-$DEFAULT_klog_enabled}
[ "$klog_enabled" = "1" ] && {
klog_file=$(nvram get klog_file)
klog_file=${klog_file:-$DEFAULT_klog_file}
klog_buffersize=$(nvram get k... | Shell |
#!/bin/sh
#
# This is an ugly solution for linux-igd, which doesn't
# reference the config file with its startup script. Need
# to create new linux-igd package with proper startup script.
#
. /lib/config/uci-depends.sh
. /lib/config/uci.sh
uci_load "upnpd"
if [ "$CONFIG_general_enable" = "0" ] && [ -f "/etc/init.d/S65u... | Shell |
#!/bin/sh
status="0"
file_check() {
for file in "$@"; do
if [ ! -f "$file" ]; then
logger -s "$0: Missing $file. Please generate and try again."
status="1"
fi
done
}
case "$1" in
start)
case "$(nvram get openvpn_cli)" in
on|enabled|1)
continue ;;
off|disabled|0)
exit 0 ;;
esac
SERVER=... | Shell |
#!/bin/sh
# create symlink to /tmp/TZ if /etc/TZ doesn't exist
# todo: -e | -f | -d didn't seem to work here, so I used find
if [ -z $(find "/etc/TZ" 2>/dev/null) ]; then
ln -s /tmp/TZ /etc/TZ
fi
# eJunky: set timezone
TZ=$(nvram get time_zone | cut -f 2)
TZ="${TZ:-UTC+0}"
echo $TZ > /etc/TZ
| Shell |
#!/bin/sh
#
# This is an ugly solution for linux-igd, which doesn't
# reference the config file with its startup script. Need
# to create new linux-igd package with proper startup script.
#
. /lib/config/uci-depends.sh
. /lib/config/uci.sh
uci_load "upnpd"
if [ "$CONFIG_general_enable" = "0" ] && [ -f "/etc/init.d/S65u... | Shell |
#!/bin/sh
# Copyright (C) 2007 X-Wrt.org
. /etc/functions.sh
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"
D... | Shell |
#!/bin/sh
# Create default language list from translations.
# (c)2006 Lubos Stanek - X-Wrt project
# Released under GPL license.
#
WEBIF_ROOT="$1"
WEBIF_TARGET="$2"
[ "$#" -lt 2 ] && {
echo "USAGE: $0 webif_base_file_folder webif_installation_folder"
exit 1
}
LANG_ROOT_DIR="etc"
LANG_ROOT_FILE="languages.root"
crea... | Shell |
#!/bin/sh
#
# Webif post-install script.
#
webif_installed_mark="/tmp/.webif-installed-marker"
#########################################################################################
# functions
TestInstall()
{
this_version="__SVN_REVISION__"
installed_version=$(cat "${IPKG_INSTROOT}/www/.version")
if [ -f "/ww... | Shell |
#!/bin/sh
#
webif_installed_mark="/tmp/.webif-installed-marker"
if [ -z "${IPKG_INSTROOT}" ]; then # only run below on 'real' system (not image builder)
ipkg list_installed |grep -q "kernel - 2.4.30"
if [ "$?" != "0" ]; then
echo "This version is for White Russian only! Please download the kamikaze version from htt... | Shell |
#!/bin/sh
#
webif_installed_mark="/tmp/.webif-installed-marker"
if [ -z "${IPKG_INSTROOT}" ]; then # only run below on 'real' system (not image builder)
ipkg list_installed |grep -q "kernel - 2.4.30"
if [ "$?" != "0" ]; then
echo "This version is for White Russian only! Please download the kamikaze version from htt... | Shell |
#!/bin/sh
#
# Webif post-install script.
#
webif_installed_mark="/tmp/.webif-installed-marker"
#########################################################################################
# functions
TestInstall()
{
this_version="__SVN_REVISION__"
installed_version=$(cat "${IPKG_INSTROOT}/www/.version")
if [ -f "/ww... | Shell |
#!/bin/sh
# Create default language list from translations.
# (c)2006 Lubos Stanek - X-Wrt project
# Released under GPL license.
#
WEBIF_ROOT="$1"
WEBIF_TARGET="$2"
[ "$#" -lt 2 ] && {
echo "USAGE: $0 webif_base_file_folder webif_installation_folder"
exit 1
}
LANG_ROOT_DIR="etc"
LANG_ROOT_FILE="languages.root"
crea... | 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
# Add missing/new symbols from translations.
# (c)2006 Owen Brotherwood and Jeremy Collake - X-Wrt project
# Released under GPL license.
#
ROOT="$1"
[ "$#" != 1 ] && {
echo "USAGE: $0 webif_base_file_folder"
echo "Assuming ./files/ as base folder ..."
ROOT="files"
}
add_missing_symbols() {
for dir... | Shell |
#!/bin/sh
# Add missing/new symbols from translations.
# (c)2006 Owen Brotherwood and Jeremy Collake - X-Wrt project
# Released under GPL license.
#
ROOT="$1"
[ "$#" != 1 ] && {
echo "USAGE: $0 webif_base_file_folder"
echo "Assuming ./files/ as base folder ..."
ROOT="files"
}
add_missing_symbols() {
for dir... | Shell |
#!/bin/sh
#
# Hotspot handler.
reload_hotspot() {
echo '@TR<<Exporting>> @TR<<hotspot settings>> ...'
[ -e "/bin/save_hotspot" ] && {
/bin/save_hotspot >&- 2>&-
}
echo '@TR<<Reloading>> @TR<<hotspot settings>> ...'
[ -e "/usr/sbin/chilli" ] && {
/etc/init.d/chilli stop >&- 2>&-
/etc/init.d/chilli start >&... | Shell |
#!/bin/sh
#
# Hotspot handler.
reload_hotspot() {
echo '@TR<<Exporting>> @TR<<hotspot settings>> ...'
[ -e "/bin/save_hotspot" ] && {
/bin/save_hotspot >&- 2>&-
}
echo '@TR<<Reloading>> @TR<<hotspot settings>> ...'
[ -e "/usr/sbin/chilli" ] && {
/etc/init.d/chilli stop >&- 2>&-
/etc/init.d/chilli start >&... | 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/sh
BIN=osirisd
DEFAULT=/etc/default/$BIN
LIB_D=/var/lib/osiris
RUN_D=/var/run
PID_F=$RUN_D/$BIN.pid
[ -f $DEFAULT ] && . $DEFAULT
case $1 in
start)
mkdir -p $LIB_D
mkdir -p $RUN_D
$BIN $OPTIONS
;;
stop)
[ -f $PID_F ] && kill $(cat $PID_F)
;;
*)
echo "usage: $0 (start|stop)"
exit 1
esac
exit ... | Shell |
#!/bin/sh
BIN=osirisd
DEFAULT=/etc/default/$BIN
LIB_D=/var/lib/osiris
RUN_D=/var/run
PID_F=$RUN_D/$BIN.pid
[ -f $DEFAULT ] && . $DEFAULT
case $1 in
start)
mkdir -p $LIB_D
mkdir -p $RUN_D
$BIN $OPTIONS
;;
stop)
[ -f $PID_F ] && kill $(cat $PID_F)
;;
*)
echo "usage: $0 (start|stop)"
exit 1
esac
exit ... | Shell |
#!/bin/sh
[ -z "$6" ] || env -i ACTION="ifdown" INTERFACE="$6" PROTO=ppp DEVICE=$1 /sbin/hotplug "iface"
[ -d /etc/ppp/ip-down.d ] && {
for SCRIPT in /etc/ppp/ip-down.d/*
do
[ -x "$SCRIPT" ] && "$SCRIPT" $@
done
}
| Shell |
#!/bin/sh
[ -z "$6" ] || env -i ACTION="ifup" INTERFACE="$6" PROTO=ppp DEVICE=$1 /sbin/hotplug "iface"
[ -d /etc/ppp/ip-up.d ] && {
for SCRIPT in /etc/ppp/ip-up.d/*
do
[ -x "$SCRIPT" ] && "$SCRIPT" $@
done
}
| Shell |
#!/bin/sh
[ -z "$6" ] || env -i ACTION="ifdown" INTERFACE="$6" PROTO=ppp DEVICE=$1 /sbin/hotplug "iface"
[ -d /etc/ppp/ip-down.d ] && {
for SCRIPT in /etc/ppp/ip-down.d/*
do
[ -x "$SCRIPT" ] && "$SCRIPT" $@
done
}
| Shell |
#!/bin/sh
[ -z "$6" ] || env -i ACTION="ifup" INTERFACE="$6" PROTO=ppp DEVICE=$1 /sbin/hotplug "iface"
[ -d /etc/ppp/ip-up.d ] && {
for SCRIPT in /etc/ppp/ip-up.d/*
do
[ -x "$SCRIPT" ] && "$SCRIPT" $@
done
}
| Shell |
#!/bin/sh
[ $# = 0 ] && { echo " $0 <group>"; exit; }
. /etc/functions.sh
type=$1
[ "$(nvram get ${type}_proto)" = "pppoe" ] || {
echo "$0: ${type}_proto isn't pppoe"
exit
}
mkdir -p /var/lock
for module in slhc ppp_generic pppox pppoe; do
/sbin/insmod $module 2>&- >&-
done
(while :; do
IFNAME=$(nvram get wan_... | Shell |
#!/bin/sh
[ $# = 0 ] && { echo " $0 <group>"; exit; }
. /etc/functions.sh
type=$1
[ "$(nvram get ${type}_proto)" = "pppoe" ] || {
echo "$0: ${type}_proto isn't pppoe"
exit
}
mkdir -p /var/lock
for module in slhc ppp_generic pppox pppoe; do
/sbin/insmod $module 2>&- >&-
done
(while :; do
IFNAME=$(nvram get wan_... | Shell |
#!/bin/sh
# backup busybox's imperfection
bblinks="bzip2 bunzip2 bzcat"
[ -z "$IPKG_INSTROOT" ] && bbhelp=$(/bin/busybox --help 2>/dev/null)
for bblink in $bblinks; do
rm -f $IPKG_INSTROOT/usr/bin/${bblink}.bb 2>/dev/null
rm -f $IPKG_INSTROOT/usr/bin/$bblink 2>/dev/null
if [ -n "$IPKG_INSTROOT" ]; then
ln -sf ../.... | Shell |
#!/bin/sh
# restore busybox's imperfection
bblinks="bzip2 bunzip2 bzcat"
[ -z "$IPKG_INSTROOT" ] && bbhelp=$(/bin/busybox --help 2>/dev/null)
for bblink in $bblinks; do
rm -f $IPKG_INSTROOT/usr/bin/${bblink}.bb 2>/dev/null
rm -f $IPKG_INSTROOT/usr/bin/$bblink 2>/dev/null
if [ -n "$IPKG_INSTROOT" ]; then
ln -sf ../... | Shell |
#!/bin/sh
# backup busybox's imperfection
bblinks="bzip2 bunzip2 bzcat"
[ -z "$IPKG_INSTROOT" ] && bbhelp=$(/bin/busybox --help 2>/dev/null)
for bblink in $bblinks; do
rm -f $IPKG_INSTROOT/usr/bin/${bblink}.bb 2>/dev/null
rm -f $IPKG_INSTROOT/usr/bin/$bblink 2>/dev/null
if [ -n "$IPKG_INSTROOT" ]; then
ln -sf ../.... | Shell |
#!/bin/sh
# restore busybox's imperfection
bblinks="bzip2 bunzip2 bzcat"
[ -z "$IPKG_INSTROOT" ] && bbhelp=$(/bin/busybox --help 2>/dev/null)
for bblink in $bblinks; do
rm -f $IPKG_INSTROOT/usr/bin/${bblink}.bb 2>/dev/null
rm -f $IPKG_INSTROOT/usr/bin/$bblink 2>/dev/null
if [ -n "$IPKG_INSTROOT" ]; then
ln -sf ../... | Shell |
#!/bin/sh
DEFAULT=/etc/default/asterisk
OPTIONS=""
[ -f $DEFAULT ] && . $DEFAULT
[ "$ENABLE_ASTERISK" = "yes" ] || exit 0
case $1 in
start)
[ -d /var/run ] || mkdir -p /var/run
[ -d /var/log/asterisk ] || mkdir -p /var/log/asterisk
[ -d /var/spool/asterisk ] || mkdir -p /var/spool/asterisk
/usr/sbin/asterisk... | Shell |
#!/bin/sh
DEFAULT=/etc/default/asterisk
OPTIONS=""
[ -f $DEFAULT ] && . $DEFAULT
[ "$ENABLE_ASTERISK" = "yes" ] || exit 0
case $1 in
start)
[ -d /var/run ] || mkdir -p /var/run
[ -d /var/log/asterisk ] || mkdir -p /var/log/asterisk
[ -d /var/spool/asterisk ] || mkdir -p /var/spool/asterisk
/usr/sbin/asterisk... | Shell |
#!/bin/sh
/usr/sbin/setserial /dev/tts/1 irq 3
| Shell |
#!/bin/sh
/usr/sbin/setserial /dev/tts/1 irq 3
| Shell |
#!/bin/sh
mkdir -p /tmp/cups
mkdir -p /tmp/spool/cups/tmp
exec /usr/sbin/cupsd
| Shell |
#!/bin/sh
mkdir -p /tmp/cups
mkdir -p /tmp/spool/cups/tmp
exec /usr/sbin/cupsd
| Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
DEFAULT=/etc/default/samba
RUN_D=/var/run/samba
NMBD_PID_F=$RUN_D/nmbd.pid
SMBD_PID_F=$RUN_D/smbd.pid
start() {
[ -f $DEFAULT ] && . $DEFAULT
mkdir -p $RUN_D
nmbd -D $NMBD_OPTIONS
smbd -D $SMBD_OPTIONS
}
stop() {
[ -f $SMBD_PID_F ] && kill $(cat $SMBD_PID... | Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
DEFAULT=/etc/default/samba
RUN_D=/var/run/samba
NMBD_PID_F=$RUN_D/nmbd.pid
SMBD_PID_F=$RUN_D/smbd.pid
start() {
[ -f $DEFAULT ] && . $DEFAULT
mkdir -p $RUN_D
nmbd -D $NMBD_OPTIONS
smbd -D $SMBD_OPTIONS
}
stop() {
[ -f $SMBD_PID_F ] && kill $(cat $SMBD_PID... | Shell |
#!/bin/sh
#
# quagga Starts/stops quagga daemons and watchquagga.
# Create a daemon.conf file to have that routing daemon
# started/stopped automagically when using this script
# without any daemon names as args.
# If watchquagga is available, it will also be
# started/stopped if the script is called without
# an... | Shell |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.