code stringlengths 1 1.96M | language stringclasses 1
value |
|---|---|
#!/bin/sh
# Copyright 2012 Roman Nurik
#
# 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
# Copyright 2012 Roman Nurik
#
# 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 2012 Roman Nurik
#
# 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 t... | Shell |
#!/bin/sh
find . -iname \.DS_Store -exec rm {} \;
rm -rf extension.zip
cd extension/
zip -qr ../extension.zip .
cd ..
zipinfo -l extension.zip
| Shell |
#!/bin/sh
# convert wubi sources to big encoding, using traditional chinese.
autob5 -i utf8 < wubi.el > wubi-b5.el
autob5 -i utf8 < wubi-rules.el > wubi-rules-b5.el
sed -i s/utf-8/big5/ wubi-b5.el wubi-rules-b5.el
| Shell |
#!/bin/sh
# convert wubi sources to big encoding, using traditional chinese.
autob5 -i utf8 < wubi.el > wubi-b5.el
autob5 -i utf8 < wubi-rules.el > wubi-rules-b5.el
sed -i s/utf-8/big5/ wubi-b5.el wubi-rules-b5.el
| Shell |
#!/bin/sh
count=`ps -ef | grep gnus_agent | grep -v grep | wc -l`
#EMACS=/Users/william/bin/emacs
EMACS=/Users/william/repo/git/emacs/nextstep/Emacs.app/Contents/MacOS/Emacs
## (其一是 script 本身,其二是父进程中的。注意到 /bin/sh)
if [ $count -eq 2 ]; then
$EMACS -batch -l ~/.emacs -f gnus-agent-batch
else
echo "Another gnus... | Shell |
#!/bin/sh
count=`ps -ef | grep gnus_agent | grep -v grep | wc -l`
#EMACS=/Users/william/bin/emacs
EMACS=/Users/william/repo/git/emacs/nextstep/Emacs.app/Contents/MacOS/Emacs
## (其一是 script 本身,其二是父进程中的。注意到 /bin/sh)
if [ $count -eq 2 ]; then
$EMACS -batch -l ~/.emacs -f gnus-agent-batch
else
echo "Another gnus... | Shell |
#!/bin/sh
if [[ -z $ADB ]]; then ADB=adb; fi
./kill_process.sh
$ADB shell rm -r /data/data/com.google.android.apps.iosched/* | Shell |
#!/bin/sh
if [[ -z $ADB ]]; then ADB=adb; fi
$ADB shell am force-stop com.google.android.apps.iosched
| Shell |
#!/bin/sh
if [[ -z $ADB ]]; then ADB=adb; fi
$ADB shell "echo '$*' | sqlite3 -header -column /data/data/com.google.android.apps.iosched/databases/schedule.db" | Shell |
#!/bin/sh
# Sessions list
#adb shell am start -a android.intent.action.VIEW -d content://com.google.android.apps.iosched/tracks/android/sessions
# Vendors list
#adb shell am start -a android.intent.action.VIEW -d content://com.google.android.apps.iosched/tracks/android/vendors
# Session detail
#adb shell am start -a... | Shell |
#!/bin/sh
if [[ -z $ADB ]]; then ADB=adb; fi
MAC_UNAME="Darwin"
if [[ "`uname`" == ${MAC_UNAME} ]]; then
DATE_FORMAT="%Y-%m-%dT%H:%M:%S"
else
DATE_FORMAT="%Y-%m-%d %H:%M:%S"
fi
if [ -z "$1" ]; then
NOW_DATE=$(date "+${DATE_FORMAT}")
echo Please provide a mock time in the format \"${NOW_DATE}\" or \"d\" to del... | Shell |
#!/bin/sh
adb shell cat /data/data/com.google.android.apps.iosched/shared_prefs/com.google.android.apps.iosched_preferences.xml | xmllint --format - | Shell |
#!/bin/sh
# Remember VERBOSE only works on debug builds of the app
adb shell setprop log.tag.iosched_SyncHelper VERBOSE
adb shell setprop log.tag.iosched_SessionsHandler VERBOSE
adb shell setprop log.tag.iosched_ImageCache VERBOSE
adb shell setprop log.tag.iosched_ImageWorker VERBOSE
adb shell setprop log.tag.iosched_I... | Shell |
#!/bin/sh
adb shell pm clear com.google.android.apps.iosched | Shell |
#!/bin/sh
if [[ -z $ADB ]]; then ADB=adb; fi
$ADB shell am start \
-a android.intent.action.MAIN \
-c android.intent.category.LAUNCHER \
-n com.google.android.apps.iosched/.ui.HomeActivity
| Shell |
#!/bin/sh
mkdir dist
mkdir dist/graphchi_v$1
cd dist/graphchi_v$1
hg clone https://code.google.com/p/graphchi/
#rm -rf src/Eigen
find . -name '*.hg' -exec rm -rf {} \;
find . -name '*.dSYM' -exec rm -fr {} \;
cd ..
tar -czf graphchi_src_v$1.tar.gz graphchi_v$1
| Shell |
./toolkits/collaborative_filtering/gensgd --training=rec_log_train.txt --val_pos=2 --rehash=1 --limit_rating=1000000 --max_iter=10 --gensgd_mult_dec=0.999999 --minval=-1 --maxval=1 --quiet=1 --calc_error=1 --file_columns=4
./toolkits/collaborative_filtering/gensgd --training=rec_log_train.txt --val_pos=2 --rehash=1 --... | Shell |
#!/bin/sh -e
#script for installing graphchi cf toolbox
#written by Danny Bickson, CMU
wget http://bitbucket.org/eigen/eigen/get/3.1.1.tar.bz2
tar -xjf 3.1.1.tar.bz2
mv eigen-eigen-*/Eigen ./src
cd toolkits/collaborative_filtering
make
cd ../../
| Shell |
# Following command makes the unittest.sh fail if any of the
# commands fail.
set -e
function display_name {
echo "****************************************************************************"
echo -n "*******************"
echo -n $1
echo "**********************"
echo "**************************************... | Shell |
#!/bin/bash
export GRAPHCHI_ROOT=$PWD/../../
stdoutfname=$PWD/stdout.log
rm -f $stdoutfname
echo | tee -a $stdoutfname
echo "Running application tests"| tee -a $stdoutfname
echo "========================="| tee -a $stdoutfname
echo "GraphChi collaborative filtering library"| tee -a $stdoutfname
somefailed=0
echo "--... | Shell |
#!/bin/sh
# script for merging the output of the rating application into a single sorted file
# Written By Danny Bickson, CMU
if [ $# -ne 1 ]; then
echo "Usage: $0 <training file name>"
exit 1
fi
TRAINING=$1
pwd
FOUND=0
rm -f *.sorted
for i in `ls ${TRAINING}.out[0-9]*`
do
FOUND=1
echo "Sorting output file $i"... | Shell |
#!/bin/sh
if [ ! -d "../../src/Eigen/" ]; then
echo "********************************************************************************"
echo "Failed to find Eigen linear algebra package!"
echo "Please follow step 3 of the instructions here: "
echo "http://bickson.blogspot.co.il/2012/08/collaborative-filterin... | Shell |
#!/bin/bash
# script for visualizing a subgraph
# Written by Danny Bickson, CMU
cd ../../
GRAPHCHI_ROOT=`pwd`
cd -
CURPATH=`pwd`
NUM_EDGES=0
FILENAME=""
SEEDS=""
HOPS=2
NODES=0;
EDGES=0;
PROGRAM_OPTIONS="f:h:n:o:r:s:"
HELP_STRING="-f Graph_file [-h hops] [-n edge_num] [-o nodes] [-s seeds] [-r multiple files regexp]\... | Shell |
#!/bin/sh
#change the website path to point to your website dir, and then run "sh refresh_website.sh" when you
#want to view your graph
cp index.html *.css *.js graph*.csv logo.gif settingA file.txt *csv.txt /afs/cs.cmu.edu/user/bickson/www/graphchi/
| Shell |
ant clean; ant release; adb install -r bin/MetaTracker-release.apk
| 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
# 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
# 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
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/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/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/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:HotSpot' "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"
else
sed -i '/##WEBIF:category:Network/a##WEBIF:category:HotSpot' "${IPKG_INSTROOT}/www/cgi-... | 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:HotSpot' "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"
else
sed -i '/##WEBIF:category:Network/a##WEBIF:category:HotSpot' "${IPKG_INSTROOT}/www/cgi-... | Shell |
#!/bin/sh
#
# Webif post-removal script.
#
sed -e '/##WEBIF:category:HotSpot/d' -i ${IPKG_INSTROOT}/www/cgi-bin/webif/.categories 2>/dev/null
| Shell |
#!/bin/sh
#
# Webif post-removal script.
#
sed -e '/##WEBIF:category:HotSpot/d' -i ${IPKG_INSTROOT}/www/cgi-bin/webif/.categories 2>/dev/null
| Shell |
#!/bin/sh
#
# Hotspot apply handler.
reload_hotspot() {
echo '@TR<<Exporting>> @TR<<hotspot settings>> ...'
[ -e /bin/save_hotspot ] && {
/bin/save_hotspot >&- 2>&-
}
(
config_cb() {
[ "$1" = "chillispot" ] && service_cfg="$2"
}
config_load "hotspot"
config_get_bool test "$service_cfg" enable 0
chilli_ini... | Shell |
#!/bin/sh
#
# Hotspot apply handler.
reload_hotspot() {
echo '@TR<<Exporting>> @TR<<hotspot settings>> ...'
[ -e /bin/save_hotspot ] && {
/bin/save_hotspot >&- 2>&-
}
(
config_cb() {
[ "$1" = "chillispot" ] && service_cfg="$2"
}
config_load "hotspot"
config_get_bool test "$service_cfg" enable 0
chilli_ini... | Shell |
#!/bin/sh
#
# Webif post-install script.
#
if $(grep -q "HotSpot" "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"); then
sed -i '/##WEBIF:category:HotSpot/a##WEBIF:category:Freeloader' "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"
elif $(grep -q "VPN" "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"); then
sed -i... | Shell |
#!/bin/sh
#
# Webif post-removal script.
#
sed -e '/##WEBIF:category:Freeloader/d' -i ${IPKG_INSTROOT}/www/cgi-bin/webif/.categories 2>/dev/null | Shell |
#!/bin/sh
#
# Webif post-removal script.
#
sed -e '/##WEBIF:category:Freeloader/d' -i ${IPKG_INSTROOT}/www/cgi-bin/webif/.categories 2>/dev/null | Shell |
#!/bin/sh
#
# Webif post-install script.
#
if $(grep -q "HotSpot" "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"); then
sed -i '/##WEBIF:category:HotSpot/a##WEBIF:category:Freeloader' "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"
elif $(grep -q "VPN" "${IPKG_INSTROOT}/www/cgi-bin/webif/.categories"); then
sed -i... | Shell |
# freeloader-include.sh created by m4rc0 02-03-2007
# version 1.3
###################################################################
# freeloader-include.sh
# (c)2007 X-Wrt project (http://www.x-wrt.org)
# (c)2007-03-02 m4rc0
#
# version 1.3
#
# Description:
# Holds the major setting for freeloader.
#
# Author(s) [in ... | Shell |
#!/bin/sh
#
# Webif post-removal script.
#
sed -e '/##WEBIF:category: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
#
if [ -z "${IPKG_INSTROOT}" ]; then # only run below on 'real' system (not image builder)
# install new httpd.conf
if [ -f "/etc/httpd.conf" ]; then
cp /etc/httpd.conf /tmp/httpd.conf.old # make a copy for comparing
else
echo > /tmp/httpd.conf.old
fi
fi | Shell |
#!/bin/sh
#
# Webif post-install script.
#
#########################################################################################
# functions
TestInstall()
{
this_version="__SVN_REVISION__"
installed_version=$(cat "${IPKG_INSTROOT}/www/.version")
if [ -f "/www/.version" ] && [ "$this_version" = "$installed_ver... | Shell |
#!/bin/sh
#
if [ -z "${IPKG_INSTROOT}" ]; then # only run below on 'real' system (not image builder)
# install new httpd.conf
if [ -f "/etc/httpd.conf" ]; then
cp /etc/httpd.conf /tmp/httpd.conf.old # make a copy for comparing
else
echo > /tmp/httpd.conf.old
fi
fi | Shell |
#!/bin/sh
#
# Webif post-install script.
#
#########################################################################################
# functions
TestInstall()
{
this_version="__SVN_REVISION__"
installed_version=$(cat "${IPKG_INSTROOT}/www/.version")
if [ -f "/www/.version" ] && [ "$this_version" = "$installed_ver... | Shell |
#!/bin/sh
# Create default language list from translations.
# (c) 2008 Lubos Stanek - X-Wrt project
# Released under GPL license.
#
WEBIF_ROOT="$1"
WEBIF_TARGET="$2"
[ "$#" -lt 2 ] && {
echo "USAGE: $0 webif_base_file_folder build_folder"
exit 1
}
LANG_ROOT_FILE="languages.root"
create_lang_list() {
tmplanglst="${... | Shell |
#!/bin/sh
#
# this script embeds the global revision number in document(s) given
# on command line
# document should have __SVN_REVISION__ where it wants the revision
# number to be placed. Wildcards okay.
#
if [ $# -lt 1 ]; then
echo " Invalid usage. Must supply one or more files."
exit 1
fi
revision_number=$(svn ... | Shell |
#!/bin/sh
# Create default language list from translations.
# (c) 2008 Lubos Stanek - X-Wrt project
# Released under GPL license.
#
WEBIF_ROOT="$1"
WEBIF_TARGET="$2"
[ "$#" -lt 2 ] && {
echo "USAGE: $0 webif_base_file_folder build_folder"
exit 1
}
LANG_ROOT_FILE="languages.root"
create_lang_list() {
tmplanglst="${... | Shell |
#!/bin/sh
#
# this script embeds the global revision number in document(s) given
# on command line
# document should have __SVN_REVISION__ where it wants the revision
# number to be placed. Wildcards okay.
#
if [ $# -lt 1 ]; then
echo " Invalid usage. Must supply one or more files."
exit 1
fi
revision_number=$(svn ... | Shell |
#!/bin/sh /etc/rc.common
START=11
timezone_config() {
local cfg="$1"
local posixtz
local etctz="/etc/TZ"
config_get posixtz "$cfg" posixtz
if [ ! -h $etctz ]; then
ln -sf /tmp/TZ "$etctz"
fi
[ -n "$posixtz" ] && echo "$posixtz" > "$etctz" || echo "UTC+0" > "$etctz"
}
start() {
config_load timezone
conf... | Shell |
#!/bin/sh /etc/rc.common
# backup dmesg
#
START=99
dmesgbackup_config() {
local cfg="$1"
local enabled file gzip GZIP_CMD
local DEFAULT_enabled=0
local DEFAULT_file="/var/log/dmesg"
local DEFAULT_gzip=1
config_get_bool enabled "$cfg" enabled "$DEFAULT_enabled"
[ "$enabled" -eq 1 ] && {
config_get file "$cfg"... | Shell |
#!/bin/sh /etc/rc.common
START=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
# Copyright (C) 2008 x-wrt.org
START=49
config_cb() {
local cfg_type="$1"
local cfg_name="$2"
case "$cfg_type" in
crontab)
append CRONTABS_cfg "$cfg_name"
;;
esac
}
start () {
config_load crontabs
echo "# WARNING: this is an auto generated file, please use uci to set cron ent... | Shell |
#!/bin/sh /etc/rc.common
#
# 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
# 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
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/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
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
#
# 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
#
# 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 |
######################################################
# 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/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
. /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
openssl dhparam -out /etc/openssl/testingfof/dh.pem 1024
##openvpn --genkey --secret ta.key
| 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
. /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/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/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/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-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 /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
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
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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.