code stringlengths 1 1.96M | language stringclasses 1
value |
|---|---|
#!/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 |
#!/bin/sh
name=quagga
id=51
# do not change below
# check if we are on real system
if [ -z "${IPKG_INSTROOT}" ]; then
# create copies of passwd and group, if we use squashfs
rootfs=`mount |awk '/root/ { print $5 }'`
if [ "$rootfs" = "squashfs" ]; then
if [ -h /etc/group ]; then
rm /etc/group
cp /rom/etc/gr... | Shell |
#!/bin/sh
name=quagga
id=51
# do not change below
# check if we are on real system
if [ -z "${IPKG_INSTROOT}" ]; then
# create copies of passwd and group, if we use squashfs
rootfs=`mount |awk '/root/ { print $5 }'`
if [ "$rootfs" = "squashfs" ]; then
if [ -h /etc/group ]; then
rm /etc/group
cp /rom/etc/gr... | Shell |
#!/bin/sh
[ $# = 0 ] && { echo " $0 <group>"; exit; }
. /etc/functions.sh
type=$1
[ "$(nvram get ${type}_proto)" = "wwan" ] || {
echo "$0: ${type}_proto isn't wwan"
exit
}
mkdir -p /var/lock
for module in slhc ppp_generic ppp_async; do
/sbin/insmod $module 2>&- >&-
done
wwan_device="$(nvram get wwan_device)"
[ ... | Shell |
#!/bin/sh
echo 0 > /proc/diag/led/3g_green
echo 0 > /proc/diag/led/3g_blue
echo 0 > /proc/diag/led/3g_blink
killall pppd
| Shell |
#!/bin/sh
# NVRAM fix for the wwan proto
WAN_PROTO="$(nvram get wan_proto)"
WAN_IFNAME="$(nvram get wan_ifname)"
case "$WAN_PROTO" in
wwan) [ "${WAN_IFNAME%%[0-9]*}" = "ppp" ] || nvram set wan_ifname=ppp0;;
esac
| Shell |
#!/bin/sh
echo 1 > /proc/diag/led/3g_blue
echo 1 > /proc/diag/led/3g_blink
/usr/sbin/chat -V -E -f /etc/chatscripts/wwan.chat
| Shell |
#!/bin/sh
[ $# = 0 ] && { echo " $0 <group>"; exit; }
. /etc/functions.sh
type=$1
[ "$(nvram get ${type}_proto)" = "wwan" ] || {
echo "$0: ${type}_proto isn't wwan"
exit
}
mkdir -p /var/lock
for module in slhc ppp_generic ppp_async; do
/sbin/insmod $module 2>&- >&-
done
wwan_device="$(nvram get wwan_device)"
[ ... | Shell |
#!/bin/sh
# NVRAM fix for the wwan proto
WAN_PROTO="$(nvram get wan_proto)"
WAN_IFNAME="$(nvram get wan_ifname)"
case "$WAN_PROTO" in
wwan) [ "${WAN_IFNAME%%[0-9]*}" = "ppp" ] || nvram set wan_ifname=ppp0;;
esac
| Shell |
#!/bin/sh
echo 0 > /proc/diag/led/3g_green
echo 0 > /proc/diag/led/3g_blue
echo 0 > /proc/diag/led/3g_blink
killall pppd
| Shell |
#!/bin/sh
echo 1 > /proc/diag/led/3g_blue
echo 1 > /proc/diag/led/3g_blink
/usr/sbin/chat -V -E -f /etc/chatscripts/wwan.chat
| Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=60
start() {
mkdir -p `grep "^ntp:" /etc/passwd | cut -d: -f6`
mkdir -p /var/db/
/usr/sbin/ntpd -s
}
stop() {
killall ntpd
}
| Shell |
#!/bin/sh
case "${ACTION:-ifup}" in
ifup)
ps | grep 'bin/[n]tpd' >&- || {
route -n 2>&- | grep '^0.0.0.0' >&- && /etc/init.d/ntpd start
}
;;
ifdown)
route -n 2>&- | grep '^0.0.0.0' >&- || /etc/init.d/ntpd stop
;;
esac
| Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=60
start() {
mkdir -p `grep "^ntp:" /etc/passwd | cut -d: -f6`
mkdir -p /var/db/
/usr/sbin/ntpd -s
}
stop() {
killall ntpd
}
| Shell |
#!/bin/sh
case "${ACTION:-ifup}" in
ifup)
ps | grep 'bin/[n]tpd' >&- || {
route -n 2>&- | grep '^0.0.0.0' >&- && /etc/init.d/ntpd start
}
;;
ifdown)
route -n 2>&- | grep '^0.0.0.0' >&- || /etc/init.d/ntpd stop
;;
esac
| Shell |
#!/bin/sh
name=ntp
id=50
# do not change below
# check if we are on real system
if [ -z "${IPKG_INSTROOT}" ]; then
# create copies of passwd and group, if we use squashfs
rootfs=`mount |awk '/root/ { print $5 }'`
if [ "$rootfs" = "squashfs" ]; then
if [ -h /etc/group ]; then
rm /etc/group
cp -p /rom/etc/gr... | Shell |
#!/bin/sh
name=ntp
id=50
# do not change below
# check if we are on real system
if [ -z "${IPKG_INSTROOT}" ]; then
# create copies of passwd and group, if we use squashfs
rootfs=`mount |awk '/root/ { print $5 }'`
if [ "$rootfs" = "squashfs" ]; then
if [ -h /etc/group ]; then
rm /etc/group
cp -p /rom/etc/gr... | Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
# Copyright (C) 2006 loswillios
START=65
WAN=$(nvram get wan_ifname)
LAN=$(nvram get lan_ifname)
start() {
echo -n "Starting UPnP: "
route add -net 239.0.0.0 netmask 255.0.0.0 $LAN
upnpd $WAN $LAN
echo "OK"
}
stop() {
echo -n "Stopping UPn... | Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
# Copyright (C) 2006 loswillios
START=65
WAN=$(nvram get wan_ifname)
LAN=$(nvram get lan_ifname)
start() {
echo -n "Starting UPnP: "
route add -net 239.0.0.0 netmask 255.0.0.0 $LAN
upnpd $WAN $LAN
echo "OK"
}
stop() {
echo -n "Stopping UPn... | Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
BIN=pmacctd
DEFAULT=/etc/default/$BIN
RUN_D=/var/run
PID_F=$RUN_D/$BIN.pid
start() {
[ -f $DEFAULT ] && . $DEFAULT
mkdir -p $RUN_D
$BIN $OPTIONS
}
stop() {
[ -f $PID_F ] && kill -INT $(cat $PID_F)
}
| Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
BIN=nfacctd
DEFAULT=/etc/default/$BIN
RUN_D=/var/run
PID_F=$RUN_D/$BIN.pid
start() {
[ -f $DEFAULT ] && . $DEFAULT
mkdir -p $RUN_D
$BIN $OPTIONS
}
stop() {
[ -f $PID_F ] && kill -INT $(cat $PID_F)
}
| Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
BIN=pmacctd
DEFAULT=/etc/default/$BIN
RUN_D=/var/run
PID_F=$RUN_D/$BIN.pid
start() {
[ -f $DEFAULT ] && . $DEFAULT
mkdir -p $RUN_D
$BIN $OPTIONS
}
stop() {
[ -f $PID_F ] && kill -INT $(cat $PID_F)
}
| Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
BIN=nfacctd
DEFAULT=/etc/default/$BIN
RUN_D=/var/run
PID_F=$RUN_D/$BIN.pid
start() {
[ -f $DEFAULT ] && . $DEFAULT
mkdir -p $RUN_D
$BIN $OPTIONS
}
stop() {
[ -f $PID_F ] && kill -INT $(cat $PID_F)
}
| 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
# 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
if [ -f ${IPKG_INSTROOT}/usr/bin/killall ]
then
echo "Hard linking pidof to killall"
ln ${IPKG_INSTROOT}/usr/bin/killall ${IPKG_INSTROOT}/bin/pidof
fi
exit 0
| Shell |
#!/bin/sh
if [ -f ${IPKG_INSTROOT}/sbin/pidof ]
then
echo "Removing hard link from pidof to killall"
rm -f ${IPKG_INSTROOT}/sbin/pidof
fi
exit 0
| Shell |
#!/bin/sh
if [ -f ${IPKG_INSTROOT}/usr/bin/killall ]
then
echo "Hard linking pidof to killall"
ln ${IPKG_INSTROOT}/usr/bin/killall ${IPKG_INSTROOT}/bin/pidof
fi
exit 0
| Shell |
#!/bin/sh
BINS="/sbin/fuser /usr/bin/killall /usr/bin/pstree /bin/pidof"
echo "Recreating original BusyBox links: "
for bin in $BINS
do
if [ ${IPKG_INSTROOT}/busybox 2>&1 | grep ${bin##/*/} >/dev/null ]
then
echo "$bin "
ln -sf ${IPKG_INSTROOT}/bin/busybox ${IPKG_INSTROOT}/$bin
fi
done
... | Shell |
#!/bin/sh
echo "Removing symbolic links to BusyBox: "
for bin in $BUILT
do
if [ -h ${IPKG_INSTROOT}/$bin ]
then
echo "$bin "
rm -f ${IPKG_INSTROOT}/$bin
elif [ -e ${IPKG_INSTROOT}/$bin ]
then
echo -e "$bin exists but is not a symbolic link.\nRe-creating BusyBox links and aborting... | Shell |
#!/bin/sh
if [ -f ${IPKG_INSTROOT}/sbin/pidof ]
then
echo "Removing hard link from pidof to killall"
rm -f ${IPKG_INSTROOT}/sbin/pidof
fi
exit 0
| Shell |
#!/bin/sh
echo "Removing symbolic links to BusyBox: "
for bin in $BUILT
do
if [ -h ${IPKG_INSTROOT}/$bin ]
then
echo "$bin "
rm -f ${IPKG_INSTROOT}/$bin
elif [ -e ${IPKG_INSTROOT}/$bin ]
then
echo -e "$bin exists but is not a symbolic link.\nRe-creating BusyBox links and aborting... | Shell |
#!/bin/sh
BINS="/sbin/fuser /usr/bin/killall /usr/bin/pstree /bin/pidof"
echo "Recreating original BusyBox links: "
for bin in $BINS
do
if [ ${IPKG_INSTROOT}/busybox 2>&1 | grep ${bin##/*/} >/dev/null ]
then
echo "$bin "
ln -sf ${IPKG_INSTROOT}/bin/busybox ${IPKG_INSTROOT}/$bin
fi
done
... | Shell |
#!/bin/sh
for type in rsa dsa; do {
# check for keys
key=/etc/ssh/ssh_host_${type}_key
[ ! -f $key ] && {
# generate missing keys
[ -x /usr/bin/ssh-keygen ] && {
/usr/bin/ssh-keygen -N '' -t $type -f $key 2>&- >&- && exec $0 $*
} &
exit 0
}
}; done
mkdir -p /var/empty
/usr/sbin/sshd
| Shell |
#!/bin/sh
for type in rsa dsa; do {
# check for keys
key=/etc/ssh/ssh_host_${type}_key
[ ! -f $key ] && {
# generate missing keys
[ -x /usr/bin/ssh-keygen ] && {
/usr/bin/ssh-keygen -N '' -t $type -f $key 2>&- >&- && exec $0 $*
} &
exit 0
}
}; done
mkdir -p /var/empty
/usr/sbin/sshd
| Shell |
#!/bin/sh
name=sshd
id=99
# do not change below
# check if we are on real system
if [ -z "${IPKG_INSTROOT}" ]; then
# create copies of passwd and group, if we use squashfs
rootfs=`mount |awk '/root/ { print $5 }'`
if [ "$rootfs" = "squashfs" ]; then
if [ -h /etc/group ]; then
rm /etc/group
cp /rom/etc/grou... | Shell |
#!/bin/sh
name=sshd
id=99
# do not change below
# check if we are on real system
if [ -z "${IPKG_INSTROOT}" ]; then
# create copies of passwd and group, if we use squashfs
rootfs=`mount |awk '/root/ { print $5 }'`
if [ "$rootfs" = "squashfs" ]; then
if [ -h /etc/group ]; then
rm /etc/group
cp /rom/etc/grou... | Shell |
#!/bin/sh
BIN=pptpd
DEFAULT=/etc/default/$BIN
RUN_D=/var/run
PID_F=$RUN_D/$BIN.pid
[ -f $DEFAULT ] && . $DEFAULT
case $1 in
start)
mkdir -p $RUN_D
for m in arc4 sha1 slhc crc-ccitt ppp_generic ppp_async ppp_mppe_mppc; do
insmod $m >/dev/null 2>&1
done
$BIN $OPTIONS
;;
stop)
[ -f $PID_F ] && kill $(ca... | Shell |
#!/bin/sh
BIN=pptpd
DEFAULT=/etc/default/$BIN
RUN_D=/var/run
PID_F=$RUN_D/$BIN.pid
[ -f $DEFAULT ] && . $DEFAULT
case $1 in
start)
mkdir -p $RUN_D
for m in arc4 sha1 slhc crc-ccitt ppp_generic ppp_async ppp_mppe_mppc; do
insmod $m >/dev/null 2>&1
done
$BIN $OPTIONS
;;
stop)
[ -f $PID_F ] && kill $(ca... | Shell |
#!/bin/sh
# The following is to automatically configure the DHCP settings
# based on nvram settings. Feel free to replace all this crap
# with a simple "dnsmasq" and manage everything via the
# /etc/dnsmasq.conf config file
# DHCP interface (lan, wan, wifi -- any ifup *)
iface=lan
ifname=$(nvram get ${iface}_ifname)
... | Shell |
#!/bin/sh
# The following is to automatically configure the DHCP settings
# based on nvram settings. Feel free to replace all this crap
# with a simple "dnsmasq" and manage everything via the
# /etc/dnsmasq.conf config file
# DHCP interface (lan, wan, wifi -- any ifup *)
iface=lan
ifname=$(nvram get ${iface}_ifname)
... | Shell |
#!/bin/sh
BINS="/usr/bin/free /bin/kill /usr/bin/pgrep /usr/bin/pkill /usr/bin/pmap \
/usr/bin/skill /usr/bin/pwdx /usr/bin/slabtop /usr/bin/snice /sbin/sysctl \
/usr/bin/tload /usr/bin/top /usr/bin/uptime /usr/bin/vmstat /usr/bin/w \
/usr/bin/watch /bin/ps"
echo "Recreating original BusyBox links: "
for bin in $BIN... | Shell |
#!/bin/sh
if [ -f ${IPKG_INSTROOT}/usr/bin/skill ]
then
echo "Hard linking snice to skill"
ln ${IPKG_INSTROOT}/usr/bin/skill /usr/bin/snice
fi
if [ -f ${IPKG_INSTROT}/usr/bin/pgrep ]
then
echo "Hard linking pkill to pgrep"
ln ${IPKG_INSTROT}/usr/bin/pgrep ${IPKG_INSTROOT}/usr/bin/snice
fi
exit 0
| Shell |
#!/bin/sh
echo "Removing symbolic links to BusyBox: "
for bin in $BUILT
do
if [ -h ${IPKG_INSTROOT}/$bin ]
then
echo "$bin "
rm -f ${IPKG_INSTROOT}/$bin
elif [ -e ${IPKG_INSTROOT}/$bin ]
then
echo -e "$bin exists but is not a symbolic link.\nRe-creating BusyBox links and aborting... | Shell |
#!/bin/sh
if [ -f ${IPKG_INSTROOT}/usr/bin/pkill ]
then
echo "Removing hard link from pkill to pgrep"
rm -f ${IPKG_INSTROOT}/usr/bin/pkill
fi
if [ -f ${IPKG_INSTROOT}/usr/bin/snice ]
then
echo "Removing hard link from snice to skill"
rm -f ${IPKG_INSTROOT}/usr/bin/skill
fi
exit 0
| Shell |
#!/bin/sh
BINS="/usr/bin/free /bin/kill /usr/bin/pgrep /usr/bin/pkill /usr/bin/pmap \
/usr/bin/skill /usr/bin/pwdx /usr/bin/slabtop /usr/bin/snice /sbin/sysctl \
/usr/bin/tload /usr/bin/top /usr/bin/uptime /usr/bin/vmstat /usr/bin/w \
/usr/bin/watch /bin/ps"
echo "Recreating original BusyBox links: "
for bin in $BIN... | Shell |
#!/bin/sh
if [ -f ${IPKG_INSTROOT}/usr/bin/skill ]
then
echo "Hard linking snice to skill"
ln ${IPKG_INSTROOT}/usr/bin/skill /usr/bin/snice
fi
if [ -f ${IPKG_INSTROT}/usr/bin/pgrep ]
then
echo "Hard linking pkill to pgrep"
ln ${IPKG_INSTROT}/usr/bin/pgrep ${IPKG_INSTROOT}/usr/bin/snice
fi
exit 0
| Shell |
#!/bin/sh
echo "Removing symbolic links to BusyBox: "
for bin in $BUILT
do
if [ -h ${IPKG_INSTROOT}/$bin ]
then
echo "$bin "
rm -f ${IPKG_INSTROOT}/$bin
elif [ -e ${IPKG_INSTROOT}/$bin ]
then
echo -e "$bin exists but is not a symbolic link.\nRe-creating BusyBox links and aborting... | Shell |
#!/bin/sh
if [ -f ${IPKG_INSTROOT}/usr/bin/pkill ]
then
echo "Removing hard link from pkill to pgrep"
rm -f ${IPKG_INSTROOT}/usr/bin/pkill
fi
if [ -f ${IPKG_INSTROOT}/usr/bin/snice ]
then
echo "Removing hard link from snice to skill"
rm -f ${IPKG_INSTROOT}/usr/bin/skill
fi
exit 0
| Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
DEFAULT=/etc/default/snmpd
LIB_D=/var/lib/snmp
LOG_D=/var/log
RUN_D=/var/run
PID_F=$RUN_D/snmpd.pid
start() {
[ -f $DEFAULT ] && . $DEFAULT
[ -d $LIB_D ] || mkdir -p $LIB_D
[ -d $LOG_D ] || mkdir -p $LOG_D
[ -d $RUN_D ] || mkdir -p $RUN_D
snmpd $OPTIONS
... | Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
DEFAULT=/etc/default/snmpd
LIB_D=/var/lib/snmp
LOG_D=/var/log
RUN_D=/var/run
PID_F=$RUN_D/snmpd.pid
start() {
[ -f $DEFAULT ] && . $DEFAULT
[ -d $LIB_D ] || mkdir -p $LIB_D
[ -d $LOG_D ] || mkdir -p $LOG_D
[ -d $RUN_D ] || mkdir -p $RUN_D
snmpd $OPTIONS
... | Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=50
BIN=lighttpd
DEFAULT=/etc/default/$BIN
LOG_D=/var/log/$BIN
RUN_D=/var/run
PID_F=$RUN_D/$BIN.pid
start() {
[ -f $DEFAULT ] && . $DEFAULT
mkdir -p $LOG_D
mkdir -p $RUN_D
$BIN $OPTIONS
}
stop() {
[ -f $PID_F ] && kill $(cat $PID_F)
}
| Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=50
BIN=lighttpd
DEFAULT=/etc/default/$BIN
LOG_D=/var/log/$BIN
RUN_D=/var/run
PID_F=$RUN_D/$BIN.pid
start() {
[ -f $DEFAULT ] && . $DEFAULT
mkdir -p $LOG_D
mkdir -p $RUN_D
$BIN $OPTIONS
}
stop() {
[ -f $PID_F ] && kill $(cat $PID_F)
}
| Shell |
#!/bin/sh
RUN_D=/var/run/vsftpd
case $1 in
start)
[ -d $RUN_D ] || mkdir -p $RUN_D
vsftpd
;;
*)
echo "usage: $0 (start)"
exit 1
esac
exit $?
| Shell |
#!/bin/sh
RUN_D=/var/run/vsftpd
case $1 in
start)
[ -d $RUN_D ] || mkdir -p $RUN_D
vsftpd
;;
*)
echo "usage: $0 (start)"
exit 1
esac
exit $?
| Shell |
#!/bin/sh
# backup busybox's imperfection
bblinks="gzip gunzip zcat"
[ -z "$IPKG_INSTROOT" ] && bbhelp=$(/bin/busybox --help 2>/dev/null)
for bblink in $bblinks; do
[ -f $IPKG_INSTROOT/bin/$bblink.bb ] && rm -f $IPKG_INSTROOT/bin/$bblink.bb 2>/dev/null
[ -f $IPKG_INSTROOT/bin/$bblink ] && rm -f $IPKG_INSTROOT/bin/$bb... | Shell |
#!/bin/sh
# backup busybox's imperfection
bblinks="gzip gunzip zcat"
[ -z "$IPKG_INSTROOT" ] && bbhelp=$(/bin/busybox --help 2>/dev/null)
for bblink in $bblinks; do
[ -f $IPKG_INSTROOT/bin/$bblink.bb ] && rm -f $IPKG_INSTROOT/bin/$bblink.bb 2>/dev/null
[ -f $IPKG_INSTROOT/bin/$bblink ] && rm -f $IPKG_INSTROOT/bin/$bb... | Shell |
#!/bin/sh
# restore busybox's imperfection
bblinks="gzip gunzip zcat"
[ -z "$IPKG_INSTROOT" ] && bbhelp=$(/bin/busybox --help 2>/dev/null)
for bblink in $bblinks; do
[ -f $IPKG_INSTROOT/bin/$bblink.bb ] && rm -f $IPKG_INSTROOT/bin/$bblink.bb 2>/dev/null
[ -f $IPKG_INSTROOT/bin/$bblink ] && rm -f $IPKG_INSTROOT/bin/$b... | Shell |
#!/bin/sh
# restore busybox's imperfection
bblinks="gzip gunzip zcat"
[ -z "$IPKG_INSTROOT" ] && bbhelp=$(/bin/busybox --help 2>/dev/null)
for bblink in $bblinks; do
[ -f $IPKG_INSTROOT/bin/$bblink.bb ] && rm -f $IPKG_INSTROOT/bin/$bblink.bb 2>/dev/null
[ -f $IPKG_INSTROOT/bin/$bblink ] && rm -f $IPKG_INSTROOT/bin/$b... | Shell |
#!/bin/sh
server=$(nvram get ntp_server)
case "${ACTION:-ifup}" in
ifup)
ps | grep 'bin/[n]tpclient' >&- || {
route -n 2>&- | grep '^0.0.0.0' >&- && /usr/sbin/ntpclient -c 1 -s -h ${server:-0.openwrt.pool.ntp.org} &
}
;;
ifdown)
route -n 2>&- | grep '^0.0.0.0' >&- || killall ntpclient 2>&- >&- ;;
esac
| Shell |
#!/bin/sh
server=$(nvram get ntp_server)
case "${ACTION:-ifup}" in
ifup)
ps | grep 'bin/[n]tpclient' >&- || {
route -n 2>&- | grep '^0.0.0.0' >&- && /usr/sbin/ntpclient -c 1 -s -h ${server:-0.openwrt.pool.ntp.org} &
}
;;
ifdown)
route -n 2>&- | grep '^0.0.0.0' >&- || killall ntpclient 2>&- >&- ;;
esac
| Shell |
#!/bin/sh
case "$1" in
start|boot)
# reasons for starting
[ -e "/etc/stunnel/stunnel.pem" ] && {
chmod og-rwx /etc/stunnel/stunnel.pem
stunnel
}
;;
stop)
killall stunnel
killall -9 stunnel
;;
esac
| Shell |
#!/bin/sh
case "$1" in
start|boot)
# reasons for starting
[ -e "/etc/stunnel/stunnel.pem" ] && {
chmod og-rwx /etc/stunnel/stunnel.pem
stunnel
}
;;
stop)
killall stunnel
killall -9 stunnel
;;
esac
| Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=60
BIN=l2tpd
DEFAULT=/etc/default/$BIN
RUN_D=/var/run
PID_F=$RUN_D/$BIN.pid
start() {
[ -f $DEFAULT ] && . $DEFAULT
$BIN $OPTIONS
}
stop() {
[ -f $PID_F ] && kill $(cat $PID_F)
}
| Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=60
BIN=l2tpd
DEFAULT=/etc/default/$BIN
RUN_D=/var/run
PID_F=$RUN_D/$BIN.pid
start() {
[ -f $DEFAULT ] && . $DEFAULT
$BIN $OPTIONS
}
stop() {
[ -f $PID_F ] && kill $(cat $PID_F)
}
| Shell |
#!/bin/sh
. /etc/functions.sh
NAME=ez-ipupdate
CONFIG=/etc/$NAME.conf
COMMAND=/usr/sbin/$NAME
[ "$ACTION" = "ifup" -a "$INTERFACE" = "wan" ] && {
[ "$(nvram get ddns_enable)" = "1" ] && [ -x $COMMAND ] && [ -r $CONFIG ] && {
IFNAME=$(nvram get ${INTERFACE}_ifname)
$COMMAND -c $CONFIG -i $IFNAME 2>&1 | logger -t $N... | Shell |
#!/bin/sh
. /etc/functions.sh
NAME=ez-ipupdate
CONFIG=/etc/$NAME.conf
COMMAND=/usr/sbin/$NAME
[ "$ACTION" = "ifup" -a "$INTERFACE" = "wan" ] && {
[ "$(nvram get ddns_enable)" = "1" ] && [ -x $COMMAND ] && [ -r $CONFIG ] && {
IFNAME=$(nvram get ${INTERFACE}_ifname)
$COMMAND -c $CONFIG -i $IFNAME 2>&1 | logger -t $N... | Shell |
#!/bin/sh
LOG_D=/var/log
RUN_D=/var/run
PID_F=$RUN_D/dhcpd-fwd.pid
case $1 in
start)
[ -d $LOG_D ] || mkdir -p $LOG_D
[ -d $RUN_D ] || mkdir -p $RUN_D
dhcp-fwd
;;
stop)
[ -f $PID_F ] && kill $(cat $PID_F)
;;
*)
echo "usage: $0 (start|stop)"
exit 1
esac
exit $?
| Shell |
#!/bin/sh
LOG_D=/var/log
RUN_D=/var/run
PID_F=$RUN_D/dhcpd-fwd.pid
case $1 in
start)
[ -d $LOG_D ] || mkdir -p $LOG_D
[ -d $RUN_D ] || mkdir -p $RUN_D
dhcp-fwd
;;
stop)
[ -f $PID_F ] && kill $(cat $PID_F)
;;
*)
echo "usage: $0 (start|stop)"
exit 1
esac
exit $?
| Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
DEFAULT=/etc/default/p910nd
RUN_D=/var/run
start() {
mkdir -p $RUN_D
[ -f $DEFAULT ] && (
while read port options; do
case "$port" in
""|\#*) continue;;
esac
p910nd $options $port
if [ $? -ne 0 ]; then
exit 1
fi
done
) < $DEFAULT
... | Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
DEFAULT=/etc/default/p910nd
RUN_D=/var/run
start() {
mkdir -p $RUN_D
[ -f $DEFAULT ] && (
while read port options; do
case "$port" in
""|\#*) continue;;
esac
p910nd $options $port
if [ $? -ne 0 ]; then
exit 1
fi
done
) < $DEFAULT
... | Shell |
#!/bin/sh
case "$1" in
start|restart)
cardmgr
;;
esac
| Shell |
#!/bin/sh
case "$1" in
start|restart)
cardmgr
;;
esac
| Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2008 X-Wrt.org
. /etc/functions.sh
START=90
NAME="smtptrapd"
DAEMON="/usr/sbin/$NAME"
RUN_D="/var/run"
EXTRA_COMMANDS="list status exconf"
EXTRA_HELP=" list Lists available configurations
status Prints status of the service
exconf Shows an example config file
The actions s... | Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2008 X-Wrt.org
. /etc/functions.sh
START=90
NAME="smtptrapd"
DAEMON="/usr/sbin/$NAME"
RUN_D="/var/run"
EXTRA_COMMANDS="list status exconf"
EXTRA_HELP=" list Lists available configurations
status Prints status of the service
exconf Shows an example config file
The actions s... | Shell |
#!/bin/sh
IDS_NAME="pci.ids"
IDS_SOURCE="$IDS_NAME.gz"
IDS_URL="http://pciids.sourceforge.net/v2.2"
DEST_PATH="/usr/share"
TMP_PATH="/tmp"
tmp_clean() {
rm -f "$TMP_PATH/$IDS_SOURCE"
rm -f "$TMP_PATH/$IDS_NAME"
}
tmp_clean
wget "$IDS_URL/$IDS_SOURCE" -O "$TMP_PATH/$IDS_SOURCE" 2>/dev/null
[ -f "$TMP_PATH/$IDS_SOUR... | Shell |
#!/bin/sh
IDS_NAME="pci.ids"
IDS_SOURCE="$IDS_NAME.gz"
IDS_URL="http://pciids.sourceforge.net/v2.2"
DEST_PATH="/usr/share"
TMP_PATH="/tmp"
tmp_clean() {
rm -f "$TMP_PATH/$IDS_SOURCE"
rm -f "$TMP_PATH/$IDS_NAME"
}
tmp_clean
wget "$IDS_URL/$IDS_SOURCE" -O "$TMP_PATH/$IDS_SOURCE" 2>/dev/null
[ -f "$TMP_PATH/$IDS_SOUR... | Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=60
STEP_FILE="/etc/default/step-servers"
VAR_RUN="/var/run"
PIDFILE="$VAR_RUN/ntpd.pid"
VAR_LIB="/var/lib/ntp"
start() {
# ln -sf /dev/ttyS0 /dev/gps0
# /usr/sbin/setgarmin -d /dev/gps -c /etc/setgarmin.conf
stop
[ -f "$STEP_FILE" ] && . "$STEP_FILE"
... | Shell |
#!/bin/sh
case "${ACTION:-ifup}" in
ifup)
ps | grep 'bin/[n]tpd' >&- || {
route -n 2>&- | grep '^0.0.0.0' >&- && /etc/init.d/ntpd start
}
;;
ifdown)
route -n 2>&- | grep '^0.0.0.0' >&- || /etc/init.d/ntpd stop
;;
esac
| Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=60
STEP_FILE="/etc/default/step-servers"
VAR_RUN="/var/run"
PIDFILE="$VAR_RUN/ntpd.pid"
VAR_LIB="/var/lib/ntp"
start() {
# ln -sf /dev/ttyS0 /dev/gps0
# /usr/sbin/setgarmin -d /dev/gps -c /etc/setgarmin.conf
stop
[ -f "$STEP_FILE" ] && . "$STEP_FILE"
... | Shell |
#!/bin/sh
case "${ACTION:-ifup}" in
ifup)
ps | grep 'bin/[n]tpd' >&- || {
route -n 2>&- | grep '^0.0.0.0' >&- && /etc/init.d/ntpd start
}
;;
ifdown)
route -n 2>&- | grep '^0.0.0.0' >&- || /etc/init.d/ntpd stop
;;
esac
| Shell |
#!/bin/sh
grep -q '^ntp[[:space:]]*123/udp' ${IPKG_INSTROOT}/etc/services 2>/dev/null
[ $? -eq 0 ] || echo "ntp 123/udp # Network Time Protocol" >>${IPKG_INSTROOT}/etc/services
grep -q '^ntp[[:space:]]*123/tcp' ${IPKG_INSTROOT}/etc/services 2>/dev/null
[ $? -eq 0 ] || echo "ntp 123/tcp # Network Time Protocol" ... | Shell |
#!/bin/sh
grep -q '^ntp[[:space:]]*123/udp' ${IPKG_INSTROOT}/etc/services 2>/dev/null
[ $? -eq 0 ] || echo "ntp 123/udp # Network Time Protocol" >>${IPKG_INSTROOT}/etc/services
grep -q '^ntp[[:space:]]*123/tcp' ${IPKG_INSTROOT}/etc/services 2>/dev/null
[ $? -eq 0 ] || echo "ntp 123/tcp # Network Time Protocol" ... | Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
BIN=ulogd
DEFAULT=/etc/default/$BIN
LOG_D=/var/log
start() {
[ -f $DEFAULT ] && . $DEFAULT
$BIN $OPTIONS
}
stop() {
killall $BIN
}
| Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
BIN=ulogd
DEFAULT=/etc/default/$BIN
LOG_D=/var/log
start() {
[ -f $DEFAULT ] && . $DEFAULT
$BIN $OPTIONS
}
stop() {
killall $BIN
}
| Shell |
#!/bin/sh
BIN=portmap
DEFAULT=/etc/default/$BIN
[ -f $DEFAULT ] && . $DEFAULT
case $1 in
start)
$BIN $OPTIONS
;;
*)
echo "usage: $0 (start)"
exit 1
esac
exit $?
| Shell |
#!/bin/sh
BIN=portmap
DEFAULT=/etc/default/$BIN
[ -f $DEFAULT ] && . $DEFAULT
case $1 in
start)
$BIN $OPTIONS
;;
*)
echo "usage: $0 (start)"
exit 1
esac
exit $?
| Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2007 X-Wrt.org
START=90
append_bool() {
local section="$1"
local option="$2"
local value="$3"
local _loctmp
config_get_bool _loctmp "$section" "$option"
[ "$_loctmp" -gt 0 ] && append args "$3"
}
append_parm() {
local section="$1"
local option="$2"
local switch="$3"
... | Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2007 X-Wrt.org
START=90
append_bool() {
local section="$1"
local option="$2"
local value="$3"
local _loctmp
config_get_bool _loctmp "$section" "$option"
[ "$_loctmp" -gt 0 ] && append args "$3"
}
append_parm() {
local section="$1"
local option="$2"
local switch="$3"
... | Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2007 X-Wrt.org
START=90
append_bool() {
local section="$1"
local option="$2"
local value="$3"
local _loctmp
config_get_bool _loctmp "$section" "$option"
[ "$_loctmp" -gt 0 ] && append args "$3"
}
append_parm() {
local section="$1"
local option="$2"
local switch="$3"
... | Shell |
#!/bin/sh /etc/rc.common
# Copyright (C) 2007 X-Wrt.org
START=90
append_bool() {
local section="$1"
local option="$2"
local value="$3"
local _loctmp
config_get_bool _loctmp "$section" "$option"
[ "$_loctmp" -gt 0 ] && append args "$3"
}
append_parm() {
local section="$1"
local option="$2"
local switch="$3"
... | Shell |
#!/bin/sh
# Copyright (C) 2006 OpenWrt.org
. $IPKG_INSTROOT/etc/functions.sh
START=50
start() {
return 0
}
stop() {
return 0
}
reload() {
return 1
}
restart() {
trap '' TERM
stop "$@"
start "$@"
}
boot() {
start "$@"
}
shutdown() {
return 0
}
disable() {
name="$(basename "${initscript}")"
rm -f "$IPK... | Shell |
#!/bin/sh
# Copyright (C) 2006 OpenWrt.org
# Copyright (C) 2006 Fokus Fraunhofer <carsten.tittel@fokus.fraunhofer.de>
. /lib/config/uci-depends.sh
alias debug=${DEBUG:-:}
# valid interface?
if_valid () (
ifconfig "$1" >&- 2>&- ||
[ "${1%%[0-9]}" = "br" ] ||
{
[ "${1%%[0-9]*}" = "vlan" ] && (
i=${1#v... | Shell |
#!/bin/sh
# Copyright (C) 2006 OpenWrt.org
. $IPKG_INSTROOT/etc/functions.sh
START=50
start() {
return 0
}
stop() {
return 0
}
reload() {
return 1
}
restart() {
trap '' TERM
stop "$@"
start "$@"
}
boot() {
start "$@"
}
shutdown() {
return 0
}
disable() {
name="$(basename "${initscript}")"
rm -f "$IPK... | Shell |
#!/bin/sh
# Copyright (C) 2006 OpenWrt.org
# Copyright (C) 2006 Fokus Fraunhofer <carsten.tittel@fokus.fraunhofer.de>
. /lib/config/uci-depends.sh
alias debug=${DEBUG:-:}
# valid interface?
if_valid () (
ifconfig "$1" >&- 2>&- ||
[ "${1%%[0-9]}" = "br" ] ||
{
[ "${1%%[0-9]*}" = "vlan" ] && (
i=${1#v... | Shell |
#!/bin/sh
# Copyright (C) 2006 OpenWrt.org
# Copyright (C) 2006 Fokus Fraunhofer <carsten.tittel@fokus.fraunhofer.de>
#
# newline (used by /lib/config/uci.sh)
N="
"
_C=0
# perform export -n only if available
_EXPORT_N_OPTION="-n"
ntest=$(export -n 2>&1)
if echo "$ntest" | grep -iq "Illegal option -n"; then
_EXPORT_N... | Shell |
#!/bin/sh
# Shell script defining macros for manipulating config files
#
# Copyright (C) 2006 Fokus Fraunhofer <carsten.tittel@fokus.fraunhofer.de>
# Copyright (C) 2006,2007 Felix Fietkau <nbd@openwrt.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU ... | Shell |
#!/bin/sh
# Shell script defining macros for manipulating config files
#
# Copyright (C) 2006 Fokus Fraunhofer <carsten.tittel@fokus.fraunhofer.de>
# Copyright (C) 2006,2007 Felix Fietkau <nbd@openwrt.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU ... | Shell |
#!/bin/sh
# Copyright (C) 2006 OpenWrt.org
# Copyright (C) 2006 Fokus Fraunhofer <carsten.tittel@fokus.fraunhofer.de>
#
# newline (used by /lib/config/uci.sh)
N="
"
_C=0
# perform export -n only if available
_EXPORT_N_OPTION="-n"
ntest=$(export -n 2>&1)
if echo "$ntest" | grep -iq "Illegal option -n"; then
_EXPORT_N... | Shell |
#!/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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.