code
stringlengths
1
1.96M
language
stringclasses
1 value
#!/bin/sh java -jar /usr/share/games/jbrickshooter/jbrickshooter.jar
Shell
#!/bin/bash Res=res/ Alt=donottranslate-altchars.xml Map=donottranslate-keymap.xml Out=assets/kbd/ mkdir -p "$Out" for Dir in res/values res/values-* do [ -f $Dir/$Map ] || continue # -o -f $Dir/$Alt ] || continue Args="$Res/values/$Alt" [ -f $Dir/$Alt ] && Args="$Args $Dir/$Alt" Args="$Args $Res/values/$Map...
Shell
#!/bin/bash getLangsForFiles () { echo "en" # default language for F in "$@" do find res/ -name "$F" done \ | sed -n ' s/.*res.[a-z]*-\(..\)-r\(..\).*/\1_\2/p; # yy-rXX => yy_XX s/.*res.[a-z]*-\(..\)\/.*/\1/p; # yy => yy ' } getLangsForDicts () { ls ../Dicts \ | sed 's/.*-//;...
Shell
#!/bin/sh cd /usr/local/rss PATH=/usr/local/bin:${PATH} mysql -u <login> -p<pass> -D <database> <yday.sql 1>yday1.log 2>yday2.log
Shell
#!/bin/sh # # PROVIDE: xbtt # REQUIRE: NETWORKING mysql # Add the following line to /etc/rc.conf to enable XBTT: # xbtt_enable (bool): Set to "NO" by default. # Set it to "YES" to enable XBTT. # xbtt_path (str): Path to dir with xbt_tracker.conf . /etc/rc.subr name="xbtt" rcvar=`set_rcvar`...
Shell
#!/bin/sh # # XBTT Start/Stop the XBT Tracker # # chkconfig: 2345 99 01 # # description: The XBT Tracker # Source function library. . /etc/init.d/functions set -e # *** CHANGE THE BELOW DEFAULT VALUES TO REFLECT YOUR SYSTEM *** # Defaults TRACKERDIR=/usr/local/xbtt/ DAEMON=/usr/local/xbtt/xbt_track...
Shell
g++ $@ -DNDEBUG -I /usr/local/include -I ../misc -I . -O3 -o xbt_tracker \ -Wl,-R/usr/local/lib/gcc44 \ ../misc/sql/database.cpp \ ../misc/sql/sql_query.cpp \ ../misc/sql/sql_result.cpp \ ../misc/bt_misc.cpp \ ../misc/bvalue.cpp \ ../misc/sha1.cpp \ ../misc/socket.cpp \ ../misc/virtual_binary.cpp \ ../misc/xc...
Shell
#!/bin/bash curl -O https://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.02.tar.gz curl -O http://leptonica.googlecode.com/files/leptonica-1.69.tar.gz tar -zxvf tesseract-ocr-3.02.02.tar.gz tar -zxvf leptonica-1.69.tar.gz rm -f tesseract-ocr-3.02.02.tar.gz rm -f leptonica-1.69.tar.gz mv tesseract-ocr jni/com_g...
Shell
#!/bin/bash curl -O http://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.eng.tar.gz tar -zxvf tesseract-ocr-3.02.eng.tar.gz rm -f tesseract-ocr-3.02.eng.tar.gz mkdir data mv tesseract-ocr data/tesseract adb push data/ /sdcard/ adb shell sync
Shell
#!/bin/bash cd empty/ ./generate.sh cd ../file_header/ ./generate.sh cd ../single_delta_encoding/ ./generate.sh cd ../double_delta_encoding/ ./generate.sh cd ../with_data/ ./generate.sh
Shell
#!/bin/bash osmosis --rx file=input.xml --mw file=output.map bbox=0,0,0.08,0.08 debug-file=true
Shell
#!/bin/bash osmosis --rx file=input.xml --mw file=output.map bbox=0.1,0.2,0.3,0.4 map-start-position=0.15,0.25 map-start-zoom=16 preferred-language=en comment=testcomment
Shell
#!/bin/bash osmosis --rx file=input.xml --mw file=output.map bbox=-1,0,0,1 encoding=single
Shell
#!/bin/bash osmosis --rx file=input.xml --mw file=output.map bbox=-1,0,0,1 encoding=double
Shell
#!/bin/bash osmosis --rx file=input.xml --mw file=output.map bbox=0.99,0.99,1.01,1.01
Shell
#!/bin/sh # # San Angeles Observation OpenGL ES version example # # This shell script builds the demo application # with executable name "SanOGLES". # # Before running it, make sure that either libGLES_CM.so # or libGLES_CL.so is available in the library path. # Alternatively you can copy one of them to the same # dire...
Shell
#!/bin/ksh # launcher script for jsdoc # Author: Avi Deitcher # # This program is released under the MIT License as follows: # Copyright (c) 2008-2009 Atomic Inc <avi@jsorm.com> # #Permission is hereby granted, free of charge, to any person #obtaining a copy of this software and associated documentation #files (the "...
Shell
#!/bin/bash # Sample shell script for invoking ant. # Copy to a new file and fill in the values below. # To keep the secrets secret, don't share your runant script. # 01234567890123456789 ant -Dsecret=<a random secret string, 20 chars long> \ -Dapp-id=your-app-id \ -Dapp-version=1 \ -Doauth-cli...
Shell
#!/bin/bash # Copyright (C) 2011 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
Shell
#!/bin/bash # Copyright (C) 2011 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
Shell
#!/bin/sh # This is for working around Android.mk's incapability to handle $* in CFLAGS, # even with SECONDEXPNASION. # LOCAL_CFLAGS:=-D_INIT=$*_init f=${1##*/} f=${f%%.*} sed "s/\([ ]*\)\(_init\)\(([ ]*void\)/\1${f}_init\3/" $1
Shell
#!/bin/bash # # iptables-apply -- a safer way to update iptables remotely # # Copyright © Martin F. Krafft <madduck@madduck.net> # Released under the terms of the Artistic Licence 2.0 # set -eu PROGNAME="${0##*/}"; VERSION=1.0 TIMEOUT=10 DEFAULT_FILE=/etc/network/iptables function blurb() { cat <<-_eof $PROGNAME $...
Shell
#! /bin/sh # set -e VERSION=1.4.7 PREV_VERSION=1.4.6 TMPDIR=/tmp/ipt-release IPTDIR="$TMPDIR/iptables-$VERSION" PATCH="patch-iptables-$PREV_VERSION-$VERSION.bz2"; TARBALL="iptables-$VERSION.tar.bz2"; CHANGELOG="changes-iptables-$PREV_VERSION-$VERSION.txt"; mkdir -p "$TMPDIR" git shortlog "v$PREV_VERSION..v$VERSION" ...
Shell
#!/bin/bash autoreconf -fi; rm -Rf autom4te*.cache;
Shell
#!/bin/bash # Test script for busybox id vs. coreutils id. # Needs root privileges for some tests. cp /usr/bin/id . BUSYBOX=./busybox ID=./id LIST=`awk -F: '{ printf "%s\n", $1 }' /etc/passwd` FLAG_USER_EXISTS="no" TEST_USER="f583ca884c1d93458fb61ed137ff44f6" echo "test 1: id [options] nousername" rm -f foo bar for O...
Shell
#!/bin/sh # Disabling features we do not match exactly: system_mke2fs='/sbin/mke2fs -O ^resize_inode' bbox_mke2fs='./busybox mke2fs' gen_image() { # params: mke2fs_invocation image_name >$2 dd seek=$((kilobytes-1)) bs=1K count=1 </dev/zero of=$2 >/dev/null 2>&1 || exit 1 $1 -F $2 $kilobytes >$2.raw_out 2>...
Shell
#!/bin/sh # udhcpc script edited by Tim Riker <Tim@Rikers.org> RESOLV_CONF="/etc/resolv.conf" [ -n "$1" ] || { echo "Error: should be called from udhcpc"; exit 1; } NETMASK="" [ -n "$subnet" ] && NETMASK="netmask $subnet" BROADCAST="broadcast +" [ -n "$broadcast" ] && BROADCAST="broadcast $broadcast" case "$1" in ...
Shell
#!/bin/sh # Sample udhcpc bound script RESOLV_CONF="/etc/udhcpc/resolv.conf" [ -n "$broadcast" ] && BROADCAST="broadcast $broadcast" [ -n "$subnet" ] && NETMASK="netmask $subnet" /sbin/ifconfig $interface $ip $BROADCAST $NETMASK if [ -n "$router" ] then echo "deleting routers" while /sbin/route del default gw 0.0...
Shell
#!/bin/sh # Sample udhcpc deconfig script /sbin/ifconfig $interface 0.0.0.0
Shell
#!/bin/sh # Sample udhcpc renew script RESOLV_CONF="/etc/udhcpc/resolv.conf" [ -n "$broadcast" ] && BROADCAST="broadcast $broadcast" [ -n "$subnet" ] && NETMASK="netmask $subnet" /sbin/ifconfig $interface $ip $BROADCAST $NETMASK if [ -n "$router" ] then echo "deleting routers" while /sbin/route del default gw 0.0...
Shell
#!/bin/sh # Sample udhcpc nak script echo Received a NAK: $message
Shell
#!/bin/sh # Currently, we only dispatch according to command. However, a more # elaborate system might dispatch by command and interface or do some # common initialization first, especially if more dhcp event notifications # are added. exec /usr/share/udhcpc/sample.$1
Shell
#!/bin/sh # only for use as a "zcip" callback script if [ "x$interface" = x ] then exit 1 fi # zcip should start on boot/resume and various media changes case "$1" in init) # for now, zcip requires the link to be already up, # and it drops links when they go down. that isn't # the most robust model... exit 0 ;...
Shell
#!/bin/sh # # Simple depmod, use to generate modprobe.conf # # Copyright (C) 2008 by Vladimir Dronnikov <dronnikov@gmail.com> # # Licensed under GPLv2, see file LICENSE in this source tree. # local BASE="${1:-/usr/lib/modules}" find "$BASE" -name '*.ko.gz' | while read I ; do N=`basename "$I" '.ko.gz'` echo -n "@$N...
Shell
# /etc/profile: system-wide .profile file for the Bourne shells echo echo -n "Processing /etc/profile... " # no-op echo "Done" echo
Shell
#! /bin/sh /bin/mount -a
Shell
#!/bin/bash # # Formats a floppy to use Syslinux dummy="" # need to have mtools installed if [ -z `which mformat` -o -z `which mcopy` ]; then echo "You must have the mtools package installed to run this script" exit 1 fi # need an arg for the location of the kernel if [ -z "$1" ]; then echo "usage: `basename $0...
Shell
#!/bin/bash # # mkrootfs.sh - creates a root file system # # TODO: need to add checks here to verify that busybox, uClibc and bzImage # exist # command-line settable variables BUSYBOX_DIR=.. UCLIBC_DIR=../../uClibc TARGET_DIR=./loop FSSIZE=4000 CLEANUP=1 MKFS='mkfs.ext2 -F' # don't-touch variables BASE_DIR=`pwd` ...
Shell
#!/bin/sh # # makedev.sh - creates device files for a busybox boot floppy image # we do our work in the dev/ directory if [ -z "$1" ]; then echo "usage: `basename $0` path/to/dev/dir" exit 1 fi cd $1 # miscellaneous one-of-a-kind stuff mknod console c 5 1 mknod full c 1 7 mknod kmem c 1 2 mknod mem c 1 1 mknod n...
Shell
#!/bin/sh # # This should work with the GNU version of tar and gzip! # This should work with the bash or ash shell! # Requires the programs (ar, tar, gzip, and the pager more or less). # usage() { echo "Usage: undeb -c package.deb <Print control file info>" echo " undeb -l package.deb <List ...
Shell
#!/bin/sh # Build Busybox against Android's bionic # Originally by Dan Fandrich # # Configure with "make android_defconfig" # # This file has been tested on Android Froyo (the lack of ttyname_r in # the android libc must be patched around) and Gingerbread. # Point this to the Android root directory; it's used in the d...
Shell
#!/bin/sh exec >/dev/null exec 2>&1 exec </dev/null user=root options="-D -2 -m /dev/psaux -t ps2" #options="-D -2 -m /dev/ttyS0 -t bare" exec \ env - PATH="$PATH" \ softlimit \ setuidgid "$user" \ gpm $options
Shell
#!/bin/sh #exec >/dev/null exec 2>&1 exec </dev/null pwd="$PWD" if="${PWD##*/ifplugd_}" echo "* Starting ifplugd on $if [$$]" exec \ env - PATH="$PATH" \ softlimit \ setuidgid root \ ifplugd -apqns -t3 -u8 -d8 -i "$if" -r "$pwd/ifplugd_handler" # We use -t3 to wake ifplugd up less often. # If after three tests (3*...
Shell
#!/bin/sh # parameters: # $1: interface # $2: state if test -d "/var/service/dhcp_$1"; then if test x"$2" = x"down"; then echo "Downing /var/service/dhcp_$1" sv d "/var/service/dhcp_$1" fi if test x"$2" = x"up"; then echo "Upping /var/service/dhcp_$1" sv u "/var/service/dhcp_$1" fi fi
Shell
#!/bin/sh cd log/logdir || exit 1 watch -n2 'w=`ttysize w`; h=`ttysize h`; tail -$((h-3)) current 2>&1 | cut -b1-$((w-2))'
Shell
#!/bin/sh user=logger logdir="/var/log/service/`(cd ..;basename $PWD)`" mkdir -p "$logdir" 2>/dev/null chown -R "$user": "$logdir" chmod -R go-rwxst,u+rwX "$logdir" rm logdir ln -s "$logdir" logdir # make this dir accessible to logger chmod a+rX . exec >/dev/null exec 2>&1 exec \ env - PATH="$PATH" \ softlimit \ se...
Shell
#!/bin/sh cd log/logdir || exit 1 cat @* current | $PAGER
Shell
#!/bin/sh ttyname=`tty` ttybase="${ttyname%%[0123456789]*}" # strip numeric tail if test "$ttybase" = "/dev/tty"; then tail="${ttyname:8}" echo "* Setting terminal device's owner to $LOGIN_UID:$LOGIN_GID" chown "$LOGIN_UID:$LOGIN_GID" "/dev/vcs$tail" "/dev/vcsa$tail" fi # We can do this also, but login does it...
Shell
#!/bin/sh exec >/dev/null exec 2>&1 exec </dev/null user=root baud=38400 delay=3 export TERM=linux tty="/dev/${PWD##*/getty_}" if ! test -e "$tty"; then exec env - sleep 32000 fi sleep "$delay" chown "$user" "$tty" # - devfs made happy exec <"$tty" >"$tty" 2>&1 # using . in order to be able to set env (TERM etc...
Shell
#!/bin/sh if test x"$TERM" = x"" -o x"$TERM" = x"unknown"; then TERM="linux" echo "* Setting TERM='$TERM'" fi export TERM ttyname=`tty` ttybase="${ttyname%%[0123456789]*}" # strip numeric tail if test x"$ttybase" = x"/dev/vc/" -o x"$ttybase" = x"/dev/tty"; then echo "* Activating Cyrillic KOI8-R -> CP866 font...
Shell
#!/bin/sh #exec >/dev/null exec 2>&1 exec </dev/null user=www user=root echo "* Starting tcpsvd for httpd [$$]" exec \ env - PATH="$PATH" \ softlimit \ tcpsvd \ -v -E -l localhost -c 5 \ 0 88 \ setuidgid "$user" \ httpd -vvv -i -h /pub/httpd_root
Shell
#!/bin/sh cd log/logdir || exit 1 watch -n2 'w=`ttysize w`; h=`ttysize h`; tail -$((h-3)) current 2>&1 | cut -b1-$((w-2))'
Shell
#!/bin/sh user=logger logdir="/var/log/service/`(cd ..;basename $PWD)`" mkdir -p "$logdir" 2>/dev/null chown -R "$user": "$logdir" chmod -R go-rwxst,u+rwX "$logdir" rm logdir ln -s "$logdir" logdir # make this dir accessible to logger chmod a+rX . exec >/dev/null exec 2>&1 exec \ env - PATH="$PATH" \ softlimit \ se...
Shell
#!/bin/sh cd log/logdir || exit 1 cat @* current | $PAGER
Shell
#!/bin/sh #exec >/dev/null exec 2>&1 exec </dev/null user=www user=root exec \ env - PATH="$PATH" \ softlimit \ tcpsvd \ -vE -l 0 -c 40 \ 0.0.0.0 21 \ setuidgid "$user" \ ftpd -vv -t10 /pub/ftpd_root
Shell
#!/bin/sh cd log/logdir || exit 1 watch -n2 'w=`ttysize w`; h=`ttysize h`; tail -$((h-3)) current 2>&1 | cut -b1-$((w-2))'
Shell
#!/bin/sh user=logger logdir="/var/log/service/`(cd ..;basename $PWD)`" mkdir -p "$logdir" 2>/dev/null chown -R "$user": "$logdir" chmod -R go-rwxst,u+rwX "$logdir" rm logdir ln -s "$logdir" logdir # make this dir accessible to logger chmod a+rX . exec >/dev/null exec 2>&1 exec \ env - PATH="$PATH" \ softlimit \ se...
Shell
#!/bin/sh cd log/logdir || exit 1 cat @* current | $PAGER
Shell
#!/bin/sh #exec >/dev/null exec 2>&1 exec </dev/null echo "* Starting inetd [$$]" exec \ env - PATH="$PATH" \ softlimit \ inetd -f -e "$PWD/inetd.conf" # inetd [-f] [-q len] [conf] # -f Run in foreground # -e Log to stderr (default is syslog) # -q N Set the size of the socket listen queue to N # ...
Shell
#!/bin/sh cd log/logdir || exit 1 watch -n2 'w=`ttysize w`; h=`ttysize h`; tail -$((h-3)) current 2>&1 | cut -b1-$((w-2))'
Shell
#!/bin/sh user=logger logdir="/var/log/service/`(cd ..;basename $PWD)`" mkdir -p "$logdir" 2>/dev/null chown -R "$user": "$logdir" chmod -R go-rwxst,u+rwX "$logdir" rm logdir ln -s "$logdir" logdir # make this dir accessible to logger chmod a+rX . exec >/dev/null exec 2>&1 exec \ env - PATH="$PATH" \ softlimit \ se...
Shell
#!/bin/sh cd log/logdir || exit 1 cat @* current | $PAGER
Shell
#!/bin/sh # Note that there is no provision to prevent several copies of the script # to be run in quick succession. In fact, it happens rather often # if initial syncronization results in a step. # You will see "step" and then "stratum" script runs, sometimes # as close as only 0.002 seconds apart. # # Script should ...
Shell
#!/bin/bash # (using bashism (arrays) in dhcp config) #exec >/dev/null exec 2>&1 exec </dev/null user=root pool="us.pool.ntp.org" # replace "us" with your country code service="${PWD##*/}" rundir="/var/run/service/$service" default_p_opt="-p 0.$pool -p 1.$pool -p 2.$pool -p 3.$pool" # Make sure rundir/ exists mkdi...
Shell
#!/bin/sh cd log/logdir || exit 1 watch -n2 'w=`ttysize w`; h=`ttysize h`; tail -$((h-3)) current 2>&1 | cut -b1-$((w-2))'
Shell
#!/bin/sh user=logger logdir="/var/log/service/`(cd ..;basename $PWD)`" mkdir -p "$logdir" 2>/dev/null chown -R "$user": "$logdir" chmod -R go-rwxst,u+rwX "$logdir" rm logdir ln -s "$logdir" logdir # make this dir accessible to logger chmod a+rX . exec >/dev/null exec 2>&1 exec \ env - PATH="$PATH" \ softlimit \ se...
Shell
#!/bin/sh cd log/logdir || exit 1 cat @* current | $PAGER
Shell
#!/bin/sh #exec >/dev/null exec 2>&1 exec </dev/null user=root # for bind to port 69 exec \ env - \ softlimit \ setuidgid "$user" \ udpsvd -v -c 10 -l localhost \ 0 69 \ tftpd /pub/tftpd_root
Shell
#!/bin/sh cd log/logdir || exit 1 watch -n2 'w=`ttysize w`; h=`ttysize h`; tail -$((h-3)) current 2>&1 | cut -b1-$((w-2))'
Shell
#!/bin/sh user=logger logdir="/var/log/service/`(cd ..;basename $PWD)`" mkdir -p "$logdir" 2>/dev/null chown -R "$user": "$logdir" chmod -R go-rwxst,u+rwX "$logdir" rm logdir ln -s "$logdir" logdir # make this dir accessible to logger chmod a+rX . exec >/dev/null exec 2>&1 exec \ env - PATH="$PATH" \ softlimit \ se...
Shell
#!/bin/sh cd log/logdir || exit 1 cat @* current | $PAGER
Shell
#!/bin/bash domain=`(. /boot.conf; echo "$DNSDOMAINNAME") 2>/dev/null` echo "# This file is automagically regenerated with each boot" echo test "$domain" && echo "domain $domain" test "$domain" && echo "search $domain" echo echo "# Note that nslookup can choke on DNS server which itself" echo "# does NOT have domain ...
Shell
#!/bin/sh echo "\ # This file is automagically regenerated # Note! /etc/nsswitch.conf may override this! # For loopbacking 127.0.0.1 localhost # Our local IPs" hostname=`hostname` test "$hostname" || hostname=localhost domain=`(. /boot.conf; echo "$DNSDOMAINNAME")` test "$domain" && hostname="$hostname $hostname.$do...
Shell
#!/bin/bash # Mostly redundant except when you need dns[]=your_static_dns_srv # let cfg=cfg+1 if[$cfg]=lo ip[$cfg]=127.0.0.1 ipmask[$cfg]=127.0.0.1/8 gw[$cfg]='' net[$cfg]='' #dns[$cfg]=127.0.0.1
Shell
#!/bin/sh # A small network with no routers # (maybe *we* are their router) # let cfg=cfg+1 if[$cfg]=if ip[$cfg]=192.168.0.1 ipmask[$cfg]=192.168.0.1/24 ### gw[$cfg]= ### net[$cfg]=0/0 ### dns[$cfg]=''
Shell
#!/bin/sh # If we have simple static address... # let cfg=cfg+1 if[$cfg]=if ip[$cfg]=11.22.33.44 ipmask[$cfg]=11.22.33.44/24 gw[$cfg]=11.22.33.1 net[$cfg]=0/0 dns[$cfg]='11.22.33.2 11.22.33.3'
Shell
#!/bin/sh echo; echo "* Firewall:" { echo '---FILTER--'; iptables -v -L -x -n; echo '---NAT-----'; iptables -t nat -v -L -x -n; echo '---MANGLE--'; iptables -t mangle -v -L -x -n; } \ | grep -v '^$' | grep -Fv 'bytes target' | $PAGER
Shell
#!/bin/bash # (using bashism: arrays) service="${PWD##*/}" rundir="/var/run/service/$service" user=root extif=if ext_open_tcp="21 22 80" # space-separated # Make ourself one-shot sv o . # Debug #date '+%Y-%m-%d %H:%M:%S' >>"$0.log" ### filter This is the default table (if no -t option is passed). It contains ### ...
Shell
#!/bin/sh # convert: # dhcptype=5 # serverid=172.16.42.102 # lease=97200 # interface=eth0 # ip=172.16.42.177 # subnet=255.255.255.0 # mask=24 # broadcast=172.16.22.255 # router=172.16.42.98 # dns=10.34.32.125 10.32.63.5 10.34.255.7 10.11.255.27 # domain=lab.example.com example.com # ntpsrv=10.34.32.125 10.34.255.7 # ...
Shell
#!/bin/sh exec 2>&1 exec </dev/null pwd="$PWD" if="${PWD##*/dhcp_}" echo "* Upping iface $if" ip link set dev "$if" up echo "* Starting udhcpc" exec \ env - PATH="$PATH" \ softlimit \ setuidgid root \ udhcpc -vv \ --hostname=null \ --foreground \ --interface="$if" \ --pidfile="$pwd/udhcpc.pid" \ --script="$pwd/dhc...
Shell
#!/bin/sh # convert: # dhcptype=5 # serverid=172.16.42.102 # lease=97200 # interface=eth0 # ip=172.16.42.177 # subnet=255.255.255.0 # mask=24 # broadcast=172.16.22.255 # router=172.16.42.98 # dns=10.34.32.125 10.32.63.5 10.34.255.7 10.11.255.27 # domain=lab.example.com example.com # ntpsrv=10.34.32.125 10.34.255.7 # ...
Shell
#!/bin/sh cd log/logdir || exit 1 watch -n2 'w=`ttysize w`; h=`ttysize h`; tail -$((h-3)) current 2>&1 | cut -b1-$((w-2))'
Shell
#!/bin/sh user=logger logdir="/var/log/service/`(cd ..;basename $PWD)`" mkdir -p "$logdir" 2>/dev/null chown -R "$user": "$logdir" chmod -R go-rwxst,u+rwX "$logdir" rm logdir ln -s "$logdir" logdir # make this dir accessible to logger chmod a+rX . exec >/dev/null exec 2>&1 exec \ env - PATH="$PATH" \ softlimit \ se...
Shell
#!/bin/sh cd log/logdir || exit 1 cat @* current | $PAGER
Shell
#!/bin/sh # executed by udhcpc # parameters: $1 and environment # $1 is: # # deconfig: udhcpc starts, or lease is lost. # Environment example: interface=eth0 # # bound: lease is obtained. Environment example: # dhcptype=5 # serverid=172.16.42.102 # lease=97200 # interface=eth0 # ip=172.16.42.177 # subnet=255.255.255.0 ...
Shell
#!/bin/sh delay=67 if=${PWD##*/dhcp_} if=${if%%_pinger} if test -f "$0.log"; then tail -999 "$0.log" >"$0.log.new" mv "$0.log.new" "$0.log" fi test -f "/var/service/dhcp_$if/dhcp_$if.out" || exec env - sleep "$delay" . "/var/service/dhcp_$if/dhcp_$if.out" test x"$router" != x"" || exec env - sleep "$delay" #echo...
Shell
#!/bin/sh exec >/dev/null exec 2>&1 exec </dev/null # Since per-process /proc/net/ (-> /proc/self/net/) appeared, # we need to be root user="root" tty="/dev/tty9" cmd="nmeter '%t %c x %x p%p f %f b %b m %m if%[nif]'" chmod -R a+X . # or else env will moan chown "$user": "$tty" # devfs made happy eval exec \ env - P...
Shell
#!/bin/sh # # This should work with the GNU version of cpio and gzip! # This should work with the bash or ash shell! # Requires the programs (cpio, gzip, and the pager more or less). # usage() { echo "Usage: unrpm -l package.rpm <List contents of rpm package>" echo " unrpm -x package.rpm /foo/boo <Ex...
Shell
#!/bin/sh $THIS_SH -c ' cleanup() { echo "child exits as expected" exit } trap cleanup HUP echo "child sleeps" sleep 1 echo "BAD exit from child!" ' & child=$! sleep 0.1 # let child install handler first kill -HUP $child wait echo "parent exits"
Shell
#!/bin/sh $THIS_SH -c ' hup() { echo "child got HUP" } trap hup HUP echo "child sleeps" sleep 1 echo "child exits" ' & child=$! sleep 0.1 # let child install handler first kill -HUP $child wait echo "parent exits"
Shell
#!/bin/sh trap "echo Trapped" BADNAME TERM; echo $? kill $$ echo Ok
Shell
#!/bin/sh # Must not find us alive { sleep 2; kill -9 $$; } 2>/dev/null & sleep 1 & PID=$! # We must exit the loop in one second. # We had bug 5304: builtins never waited for exited children while kill -0 $PID >/dev/null 2>&1; do true done echo Ok
Shell
#!/bin/sh TOPDIR=$PWD test -x ash || { echo "No ./ash - creating a link to ../../busybox" ln -s ../../busybox ash } test -x printenv || gcc -O2 -o printenv printenv.c || exit $? test -x recho || gcc -O2 -o recho recho.c || exit $? test -x zecho || gcc -O2 -o zecho zecho.c || exit $? PATH="$...
Shell
#!/bin/sh unset LANG LANGUAGE unset LC_COLLATE unset LC_CTYPE unset LC_MONETARY unset LC_MESSAGES unset LC_NUMERIC unset LC_TIME unset LC_ALL if test ! -x hush; then if test ! -x ../../busybox; then echo "Can't run tests. Put hush binary into this directory (`pwd`)" exit 1 fi echo "No ./hush - creating a link ...
Shell
#!/bin/sh test -x msh || { echo "No ./msh - creating a link to ../../busybox" ln -s ../../busybox msh } PATH="$PWD:$PATH" # for msh export PATH THIS_SH="$PWD/msh" export THIS_SH do_test() { test -d "$1" || return 0 # echo Running tests in directory "$1" ( cd "$1" || { echo "cannot cd $1!"; exi...
Shell
#!/bin/sh # hush's stderr with leak debug enabled output=output freelist=`grep 'free 0x' "$output" | cut -d' ' -f2 | sort | uniq | xargs` grep -v free "$output" >"$output.leaked" i=8 list= for freed in $freelist; do list="$list -e $freed" test $((--i)) != 0 && continue echo Dropping $list grep -F -v...
Shell
#!/bin/sh # Copyright 2006 Rob Landley <rob@landley.net> # Licensed under GPLv2 or later, see file LICENSE in this source tree. # Dumb little utility function to print out the assembly dump of a single # function, or list the functions so dumpable in an executable. You'd think # there would be a way to get objdump t...
Shell
#!/bin/sh busybox=../busybox $busybox sleep 10 & pid=$! sleep 1 echo "Memory map of '$busybox sleep 10':" size $busybox pmap $pid | env - grep "^[0-9a-f][0-9a-f]* " | sort -r -t " " -k2,999
Shell
#!/bin/sh # Check ncurses compatibility # What library to link ldflags() { for ext in so a dylib ; do for lib in ncursesw ncurses curses ; do $cc -print-file-name=lib${lib}.${ext} | grep -q / if [ $? -eq 0 ]; then echo "-l${lib}" exit fi done done exit 1 } # Where is ncurses.h? ccflags() { if...
Shell
#!/bin/sh # Needed for systems without gettext $* -xc -o /dev/null - > /dev/null 2>&1 << EOF #include <libintl.h> int main() { gettext(""); return 0; } EOF if [ ! "$?" -eq "0" ]; then echo -DKBUILD_NO_NLS; fi
Shell