code
stringlengths
1
1.96M
language
stringclasses
1 value
#!/bin/sh test_description='commit-msg hook' . ./test-lib.sh test_expect_success 'with no hook' ' echo "foo" > file && git add file && git commit -m "first" ' # set up fake editor for interactive editing cat > fake-editor <<'EOF' #!/bin/sh cp FAKE_MSG "$1" exit 0 EOF chmod +x fake-editor ## Not using test_set...
Shell
#!/bin/sh # # Copyright (c) 2012 Zbigniew Jędrzejewski-Szmek # test_description='test --stat output of various commands' . ./test-lib.sh . "$TEST_DIRECTORY"/lib-terminal.sh # 120 character name name=aaaaaaaaaa name=$name$name$name$name$name$name$name$name$name$name$name$name test_expect_success 'preparation' ' >"$n...
Shell
#!/bin/sh test_description='tests for ref^{stuff}' . ./test-lib.sh test_expect_success 'setup' ' echo blob >a-blob && git tag -a -m blob blob-tag `git hash-object -w a-blob` && mkdir a-tree && echo moreblobs >a-tree/another-blob && git add . && TREE_SHA1=`git write-tree` && git tag -a -m tree tree-tag "$TREE_...
Shell
#!/bin/sh # # Copyright (c) 2010 Ævar Arnfjörð Bjarmason # test_description='Gettext Shell poison' . ./lib-gettext.sh test_expect_success GETTEXT_POISON "sanity: \$GIT_INTERNAL_GETTEXT_SH_SCHEME is set (to $GIT_INTERNAL_GETTEXT_SH_SCHEME)" ' test -n "$GIT_INTERNAL_GETTEXT_SH_SCHEME" ' test_expect_success GETTEX...
Shell
#!/bin/sh # # Copyright (c) 2009 Eric Wong test_description='git svn refuses to dcommit non-UTF8 messages' . ./lib-git-svn.sh # ISO-2022-JP can pass for valid UTF-8, so skipping that in this test for H in ISO8859-1 eucJP do test_expect_success "$H setup" ' mkdir $H && svn_cmd import -m "$H test" $H "$svnrepo"/...
Shell
#!/bin/sh test_description='forced push to replace commit we do not have' . ./test-lib.sh test_expect_success setup ' >file1 && git add file1 && test_tick && git commit -m Initial && git config receive.denyCurrentBranch warn && mkdir another && ( cd another && git init && git fetch --update-head-ok .. ma...
Shell
#!/bin/sh # # Copyright (c) 2008 Jan Krüger # test_description='git svn respects rewriteRoot during rebuild' . ./lib-git-svn.sh mkdir import (cd import touch foo svn_cmd import -m 'import for git svn' . "$svnrepo" >/dev/null ) rm -rf import test_expect_success 'init, fetch and checkout repository' ' git svn init...
Shell
#!/bin/sh test_description='git status for submodule' . ./test-lib.sh test_create_repo_with_commit () { test_create_repo "$1" && ( cd "$1" && : >bar && git add bar && git commit -m " Add bar" && : >foo && git add foo && git commit -m " Add foo" ) } test_expect_success 'setup' ' test_create_repo_wi...
Shell
: included from t2016 and others . ./test-lib.sh set_state () { echo "$3" > "$1" && git add "$1" && echo "$2" > "$1" } save_state () { noslash="$(echo "$1" | tr / _)" && cat "$1" > _worktree_"$noslash" && git show :"$1" > _index_"$noslash" } set_and_save_state () { set_state "$@" && save_state "$1" } verif...
Shell
#!/bin/sh test_description='checkout and pathspecs/refspecs ambiguities' . ./test-lib.sh test_expect_success 'setup' ' echo hello >world && echo hello >all && git add all world && git commit -m initial && git branch world ' test_expect_success 'reference must be a tree' ' test_must_fail git checkout $(git has...
Shell
#!/bin/sh test_description='apply with fuzz and offset' . ./test-lib.sh dotest () { name="$1" && shift && test_expect_success "$name" " git checkout-index -f -q -u file && git apply $* && test_cmp expect file " } test_expect_success setup ' for i in 1 2 3 4 5 6 7 8 9 10 11 12 do echo $i done >file &&...
Shell
#!/bin/sh test_description='merge-recursive backend test' . ./test-lib.sh # A <- create some files # / \ # B C <- cause rename/delete conflicts between B and C # / \ # |\ /| # | D E | # | \ / | # | X | # | / \ | # | / \ | # |/ \|...
Shell
#!/bin/sh test_description='test separate work tree' . ./test-lib.sh test_expect_success 'setup' ' EMPTY_TREE=$(git write-tree) && EMPTY_BLOB=$(git hash-object -t blob --stdin </dev/null) && CHANGED_BLOB=$(echo changed | git hash-object -t blob --stdin) && EMPTY_BLOB7=$(echo $EMPTY_BLOB | sed "s/\(.......\).*/\1/...
Shell
#!/bin/sh # # Copyright (c) 2005 Junio C Hamano # test_description='git mailinfo and git mailsplit test' . ./test-lib.sh test_expect_success 'split sample box' \ 'git mailsplit -o. "$TEST_DIRECTORY"/t5100/sample.mbox >last && last=`cat last` && echo total is $last && test `cat last` = 16' check_mailinfo () { m...
Shell
#!/bin/sh test_description='Return value of diffs' . ./test-lib.sh test_expect_success 'setup' ' echo 1 >a && git add . && git commit -m first && echo 2 >b && git add . && git commit -a -m second ' test_expect_success 'git diff-tree HEAD^ HEAD' ' git diff-tree --quiet HEAD^ HEAD >cnt test $? = 1 && test_lin...
Shell
#!/bin/sh test_description='test that git handles an svn repository with empty symlinks' . ./lib-git-svn.sh test_expect_success 'load svn dumpfile' ' svnadmin load "$rawsvnrepo" <<EOF SVN-fs-dump-format-version: 2 UUID: 60780f9a-7df5-43b4-83ab-60e2c0673ef7 Revision-number: 0 Prop-content-length: 56 Content-length:...
Shell
#!/bin/sh # # Copyright (c) 2009 Greg Price # test_description='git rebase -p should respect --onto In a rebase with --onto, we should rewrite all the commits that aren'"'"'t on top of $ONTO, even if they are on top of $UPSTREAM. ' . ./test-lib.sh . "$TEST_DIRECTORY"/lib-rebase.sh # Set up branches like this: # A1-...
Shell
#!/bin/sh test_description='git merge Testing pull.* configuration parsing.' . ./test-lib.sh test_expect_success 'setup' ' echo c0 >c0.c && git add c0.c && git commit -m c0 && git tag c0 && echo c1 >c1.c && git add c1.c && git commit -m c1 && git tag c1 && git reset --hard c0 && echo c2 >c2.c && git add ...
Shell
#!/bin/sh # # Copyright (C) 2005 Rene Scharfe # test_description='git tar-tree and git get-tar-commit-id test This test covers the topics of file contents, commit date handling and commit id embedding: The contents of the repository is compared to the extracted tar archive. The repository contains simple text f...
Shell
#!/bin/sh test_description='git filter-branch' . ./test-lib.sh test_expect_success 'setup' ' test_commit A && test_commit B && git checkout -b branch B && test_commit D && mkdir dir && test_commit dir/D && test_commit E && git checkout master && test_commit C && git checkout branch && git merge C && git t...
Shell
#!/bin/sh test_description='Return value of diffs' . ./test-lib.sh test_expect_success 'setup' ' echo "1 " >a && git add . && git commit -m zeroth && echo 1 >a && git add . && git commit -m first && echo 2 >b && git add . && git commit -a -m second ' test_expect_success 'git diff --quiet -w HEAD^^ HEAD^' ...
Shell
#!/bin/sh test_description='apply empty' . ./test-lib.sh test_expect_success setup ' >empty && git add empty && test_tick && git commit -m initial && for i in a b c d e do echo $i done >empty && cat empty >expect && git diff | sed -e "/^diff --git/d" \ -e "/^index /d" \ -e "s|a/empty|empty.orig...
Shell
#!/bin/sh test_description='applying patch with mode bits' . ./test-lib.sh . "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh test_expect_success setup ' echo original >file && git add file && test_tick && git commit -m initial && git tag initial && echo modified >file && git diff --stat -p >patch-0.txt && chmod +x ...
Shell
#!/bin/sh # # Copyright (c) 2007 Johannes Sixt # test_description='git update-index on filesystem w/o symlinks test. This tests that git update-index keeps the symbolic link property even if a plain file is in the working tree if core.symlinks is false.' . ./test-lib.sh test_expect_success \ 'preparation' ' git con...
Shell
#!/bin/sh # # Copyright (c) 2007 Johannes Schindelin # test_description='Test shared repository initialization' . ./test-lib.sh # Remove a default ACL from the test dir if possible. setfacl -k . 2>/dev/null # User must have read permissions to the repo -> failure on --shared=0400 test_expect_success 'shared = 0400 ...
Shell
#!/bin/sh # # Copyright (c) 2005 Junio C Hamano # test_description='git checkout-index test. This test registers the following filesystem structure in the cache: path0 - a file path1/file1 - a file in a directory And then tries to checkout in a work tree that has the following: path0/file0 - a fi...
Shell
#!/bin/sh # # Copyright (c) 2005 Johannes Schindelin # test_description='Test diff of symlinks. ' . ./test-lib.sh . "$TEST_DIRECTORY"/diff-lib.sh test_expect_success SYMLINKS 'diff new symlink and file' ' cat >expected <<-\EOF && diff --git a/frotz b/frotz new file mode 120000 index 0000000..7c465af --- /dev/nu...
Shell
#!/bin/sh test_description='Merge-recursive ours and theirs variants' . ./test-lib.sh test_expect_success setup ' for i in 1 2 3 4 5 6 7 8 9 do echo "$i" done >file && git add file && cp file elif && git commit -m initial && sed -e "s/1/one/" -e "s/9/nine/" >file <elif && git commit -a -m ours && git che...
Shell
#!/bin/sh test_description='unpack-objects' . ./test-lib.sh test_expect_success setup ' mkdir pub.git && GIT_DIR=pub.git git init --bare && GIT_DIR=pub.git git config receive.fsckobjects true && mkdir work && ( cd work && git init && mkdir -p gar/bage && ( cd gar/bage && git init && >junk && ...
Shell
#!/bin/sh # # Copyright (c) 2005 Fredrik Kuivinen # # See http://marc.theaimsgroup.com/?l=git&m=111463358500362&w=2 for a # nice description of what this is about. test_description='Test criss-cross merge' . ./test-lib.sh test_expect_success 'prepare repository' \ 'echo "1 2 3 4 5 6 7 8 9" > file && git add file &&...
Shell
#!/bin/sh test_description='Test git check-ref-format' . ./test-lib.sh valid_ref() { prereq= case $1 in [A-Z]*) prereq=$1 shift esac test_expect_success $prereq "ref name '$1' is valid${2:+ with options $2}" " git check-ref-format $2 '$1' " } invalid_ref() { prereq= case $1 in [A-Z]*) prereq=$1 sh...
Shell
#!/bin/sh test_description='Test commit notes organized in subtrees' . ./test-lib.sh number_of_commits=100 start_note_commit () { test_tick && cat <<INPUT_END commit refs/notes/commits committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT notes COMMIT from refs/notes/commits^0 de...
Shell
#!/bin/sh test_description='basic symbolic-ref tests' . ./test-lib.sh # If the tests munging HEAD fail, they can break detection of # the git repo, meaning that further tests will operate on # the surrounding git repo instead of the trash directory. reset_to_sane() { echo ref: refs/heads/foo >.git/HEAD } test_expec...
Shell
#!/bin/sh test_description='operations that cull histories in unusual ways' . ./test-lib.sh test_expect_success setup ' test_commit A && test_commit B && test_commit C && git checkout -b side HEAD^ && test_commit D && test_commit E && git merge master ' test_expect_success 'rev-list --first-parent --boundary'...
Shell
#!/bin/sh test_description='push to a repository that borrows from elsewhere' . ./test-lib.sh test_expect_success setup ' mkdir alice-pub && ( cd alice-pub && GIT_DIR=. git init ) && mkdir alice-work && ( cd alice-work && git init && >file && git add . && git commit -m initial && git push ../ali...
Shell
#!/bin/sh # # Copyright (c) 2008 Timo Hirvonen # test_description='Test diff/status color escape codes' . ./test-lib.sh color() { actual=$(git config --get-color no.such.slot "$1") && test "$actual" = "$2" } invalid_color() { test_must_fail git config --get-color no.such.slot "$1" } test_expect_success 'reset' ...
Shell
#!/bin/sh test_description='recursive merge corner cases involving criss-cross merges' . ./test-lib.sh get_clean_checkout () { git reset --hard && git clean -fdqx && git checkout "$1" } # # L1 L2 # o---o # / \ / \ # o X ? # \ / \ / # o---o # R1 R2 # test_expect_success 'setup basic criss-cross + r...
Shell
#!/bin/sh # # Copyright (c) 2010 Johan Herland # test_description='Test notes merging with manual conflict resolution' . ./test-lib.sh # Set up a notes merge scenario with different kinds of conflicts test_expect_success 'setup commits' ' test_commit 1st && test_commit 2nd && test_commit 3rd && test_commit 4th &...
Shell
#!/bin/sh # # Copyright (c) 2006 Junio C Hamano # test_description='commit and log output encodings' . ./test-lib.sh compare_with () { git show -s $1 | sed -e '1,/^$/d' -e 's/^ //' >current && case "$3" in '') test_cmp "$2" current ;; ?*) iconv -f "$3" -t UTF-8 >current.utf8 <current && iconv -f "$3" -t...
Shell
#!/bin/sh test_description='Examples from the git-notes man page Make sure the manual is not full of lies.' . ./test-lib.sh test_expect_success 'setup' ' test_commit A && test_commit B && test_commit C ' test_expect_success 'example 1: notes to add an Acked-by line' ' cat <<-\EOF >expect && B Notes: ...
Shell
#!/bin/sh test_description='remote push rejects are reported by client' . ./test-lib.sh test_expect_success 'setup' ' mkdir .git/hooks && (echo "#!/bin/sh" ; echo "exit 1") >.git/hooks/update && chmod +x .git/hooks/update && echo 1 >file && git add file && git commit -m 1 && git clone . child && cd child && ...
Shell
#!/bin/sh test_description='git p4 skipSubmitEdit config variables' . ./lib-git-p4.sh test_expect_success 'start p4d' ' start_p4d ' test_expect_success 'init depot' ' ( cd "$cli" && echo file1 >file1 && p4 add file1 && p4 submit -d "change 1" ) ' # this works because EDITOR is set to : test_expect_succe...
Shell
#!/bin/sh # # Copyright (c) 2008 Santhosh Kumar Mani test_description='git svn can fetch renamed directories' . ./lib-git-svn.sh test_expect_success 'load repository with renamed directory' ' svnadmin load -q "$rawsvnrepo" < "$TEST_DIRECTORY"/t9121/renamed-dir.dump ' test_expect_success 'init and fetch repositor...
Shell
#!/bin/sh # # Copyright (c) 2009 Robert Zeh test_description='git svn creates empty directories, calls git gc, makes sure they are still empty' . ./lib-git-svn.sh test_expect_success 'initialize repo' ' for i in a b c d d/e d/e/f "weird file name" do svn_cmd mkdir -m "mkdir $i" "$svnrepo"/"$i" done ' test_expec...
Shell
#!/bin/sh test_description='credential-store tests' . ./test-lib.sh . "$TEST_DIRECTORY"/lib-credential.sh helper_test store test_done
Shell
#!/bin/sh test_description='test git-http-backend' . ./test-lib.sh if test -n "$NO_CURL"; then skip_all='skipping test, git built without http support' test_done fi LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5561'} . "$TEST_DIRECTORY"/lib-httpd.sh start_httpd GET() { curl --include "$HTTPD_URL/$SMART/repo.git/$1" >out 2>/...
Shell
#!/bin/sh # # Copyright (c) 2010 Thomas Rast # test_description='Test the post-rewrite hook.' . ./test-lib.sh test_expect_success 'setup' ' test_commit A foo A && test_commit B foo B && test_commit C foo C && test_commit D foo D && git checkout A^0 && test_commit E bar E && test_commit F foo F && git checkout...
Shell
#!/bin/sh test_description='diff function context' . ./test-lib.sh . "$TEST_DIRECTORY"/diff-lib.sh cat <<\EOF >hello.c #include <stdio.h> static int a(void) { /* * Dummy. */ } static int hello_world(void) { /* Classic. */ printf("Hello world.\n"); /* Success! */ return 0; } static int b(void) { /* * ...
Shell
#!/bin/sh test_description='test cherry-pick and revert with conflicts - + picked: rewrites foo to c + base: rewrites foo to b + initial: writes foo as a, unrelated as unrelated ' . ./test-lib.sh test_cmp_rev () { git rev-parse --verify "$1" >expect.rev && git rev-parse --verify "$2" >actual.rev && test...
Shell
#!/bin/sh test_description='git merge Testing octopus merge with more than 25 refs.' . ./test-lib.sh test_expect_success 'setup' ' echo c0 > c0.c && git add c0.c && git commit -m c0 && git tag c0 && i=1 && while test $i -le 30 do git reset --hard c0 && echo c$i > c$i.c && git add c$i.c && git commit ...
Shell
#!/bin/sh test_description='test cherry-pick and revert with renames -- + rename2: renames oops to opos + rename1: renames oops to spoo + added: adds extra line to oops ++ initial: has lines in oops ' . ./test-lib.sh test_expect_success setup ' for l in a b c d e f g h i j k l m n o do echo $l$...
Shell
#!/bin/sh # # Copyright (C) 2006 Carl D. Worth <cworth@cworth.org> # test_description='test git clone to cleanup after failure This test covers the fact that if git clone fails, it should remove the directory it created, to avoid the user having to manually remove the directory before attempting a clone again.' . ./...
Shell
#!/bin/sh find_file() { cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" && find $1 -type f | sed -e 1q } config() { git --git-dir="$HTTPD_DOCUMENT_ROOT_PATH/repo.git" config $1 $2 } test_expect_success 'setup repository' ' echo content >file && git add file && git commit -m one && mkdir "$HTTPD_DOCUMENT_ROOT_PATH/r...
Shell
#!/bin/sh # # Copyright (c) 2006 Eric Wong # test_description='git svn property tests' . ./lib-git-svn.sh mkdir import a_crlf= a_lf= a_cr= a_ne_crlf= a_ne_lf= a_ne_cr= a_empty= a_empty_lf= a_empty_cr= a_empty_crlf= cd import cat >> kw.c <<\EOF /* Somebody prematurely put a keyword into this file */ /* $Id$ */ EOF ...
Shell
#!/bin/sh # git-difftool--helper is a GIT_EXTERNAL_DIFF-compatible diff tool launcher. # This script is typically launched by using the 'git difftool' # convenience command. # # Copyright (c) 2009, 2010 David Aguilar TOOL_MODE=diff . git-mergetool--lib # difftool.prompt controls the default prompt/no-prompt behavior ...
Shell
#!/bin/sh # # git-submodules.sh: add, init, update or list git submodules # # Copyright (c) 2007 Lars Hjemli dashless=$(basename "$0" | sed -e 's/-/ /') USAGE="[--quiet] add [-b branch] [-f|--force] [--reference <repository>] [--] <repository> [<path>] or: $dashless [--quiet] status [--cached] [--recursive] [--] [<...
Shell
#!/bin/sh # # This program launch a web browser on the html page # describing a git command. # # Copyright (c) 2007 Christian Couder # Copyright (c) 2006 Theodore Y. Ts'o # # This file is heavily stolen from git-mergetool.sh, by # Theodore Y. Ts'o (thanks) that is: # # Copyright (c) 2006 Theodore Y. Ts'o # # This file ...
Shell
#!/bin/sh # git-mergetool--lib is a library for common merge tool functions diff_mode() { test "$TOOL_MODE" = diff } merge_mode() { test "$TOOL_MODE" = merge } translate_merge_tool_path () { echo "$1" } check_unchanged () { if test "$MERGED" -nt "$BACKUP" then status=0 else while true do echo "$MERGED...
Shell
#!/bin/sh # # Copyright (c) 2006 Johannes E. Schindelin # SHORT DESCRIPTION # # This script makes it easy to fix up commits in the middle of a series, # and rearrange commits. # # The original idea comes from Eric W. Biederman, in # http://article.gmane.org/gmane.comp.version-control.git/22407 . git-sh-setup # The f...
Shell
#!/bin/sh # # Copyright (c) 2006 Eric Wong # PERL='@@PERL@@' OPTIONS_KEEPDASHDASH= OPTIONS_SPEC="\ git instaweb [options] (--start | --stop | --restart) -- l,local only bind on 127.0.0.1 p,port= the port to bind to d,httpd= the command to launch b,browser= the browser to launch m,module-path= t...
Shell
#!/bin/sh # This is a very, _very_, simple script to convert a tab-separated # .txt file into a .pot/.po. # Its not clever but it took me 2 minutes to write :) # Michael Twomey <michael.twomey@ireland.sun.com> # 23 March 2001 # with slight GnuCash modifications by Christian Stimming <stimming@tuhh.de> # 19 Aug 2001, 23...
Shell
#!/bin/sh GVF=GIT-VERSION-FILE DEF_VER=0.16.GITGUI LF=' ' tree_search () { head=$1 tree=$2 for p in $(git rev-list --parents --max-count=1 $head 2>/dev/null) do test $tree = $(git rev-parse $p^{tree} 2>/dev/null) && vn=$(git describe --abbrev=4 $p 2>/dev/null) && case "$vn" in gitgui-[0-9]*) echo $vn; br...
Shell
#!/bin/sh bindir="$1" gitexecdir="$2" gitcmd="$3" if test "$bindir" != "$gitexecdir" -a -x "$gitcmd" then echo echo "!! You have installed git-* commands to new gitexecdir." echo "!! Old version git-* commands still remain in bindir." echo "!! Mixing two versions of Git will lead to problems." echo "!! Please remo...
Shell
#!/bin/sh # wrap-for-bin.sh: Template for git executable wrapper scripts # to run test suite against sandbox, but with only bindir-installed # executables in PATH. The Makefile copies this into various # files in bin-wrappers, substituting # @@BUILD_DIR@@ and @@PROG@@. GIT_EXEC_PATH='@@BUILD_DIR@@' if test -n "$NO_S...
Shell
#!/bin/sh # # dex2jar - Tools to work with android .dex and java .class files # Copyright (c) 2009-2012 Panxiaobo # # 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...
Shell
#adb install -r application/target/gaswalker-0.0.9-beta-1.apk device="" if [ $# -ne 0 ];then device="-s $1" fi adb $device shell "am start -a android.intent.action.MAIN -n com.gasolinator.a/.GasolinatorActivity"
Shell
adb install -r target/gaswalker-0.0.9-beta-1.apk adb shell "am start -a android.intent.action.MAIN -n com.gasolinator.a/.GasolinatorActivity"
Shell
#!/bin/bash function dumplib() { LIB=$1 for arch in armeabi-v7a armeabi; do VER=$(dump_syms obj/local/$arch/$LIB |grep MODULE | cut -d " " -f 4) mkdir -p symbols/$LIB/$VER dump_syms obj/local/armeabi-v7a/$LIB > symbols/$LIB/$VER/$LIB.sym done } dumplib libopenvpn.so
Shell
#!/bin/bash #NDK_DEBUG=1 ndk-build -j8 # Quick and dirty from ndk-gdb . ${ANDROID_NDK_HOME}/build/tools/ndk-common.sh ANDROID_NDK_ROOT=${ANDROID_NDK_HOME} PROJECT=. APP_ABI=armeabi-v7a AWK_SCRIPTS=${ANDROID_NDK_ROOT}/build/awk PACKAGE_NAME=de.blinkt.openvpn DEBUG_PORT=5039 JDB_PORT=65534 ADB_CMD=adb AWK_CMD=awk ge...
Shell
OPENVPN_PACKAGE_NAME="@PACKAGE_NAME@" OPENVPN_PACKAGE_TARNAME="@PACKAGE_TARNAME@" OPENVPN_PACKAGE_VERSION="@PACKAGE_VERSION@" OPENVPN_PACKAGE_HOST="@host@"
Shell
#!@SHELL@ # # run OpenVPN client against ``test reference'' server # - check that ping, http, ... via tunnel works # - check that interface config / routes are properly cleaned after test end # # prerequisites: # - openvpn binary in current directory # - writable current directory to create subdir for logs # - t_client...
Shell
#! /bin/sh # # t_lpback.sh - script to test OpenVPN's crypto loopback # Copyright (C) 2005 Matthias Andree # Copyright (C) 2014 Steffan Karger # # 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;...
Shell
#! /bin/sh # # t_cltsrv.sh - script to test OpenVPN's crypto loopback # Copyright (C) 2005, 2006, 2008 Matthias Andree # # 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 # of th...
Shell
#! /bin/sh echo "${role}:${signal}" >&3
Shell
#!/bin/sh # # Bring up vpn routing. # calculate the network address remote_network=`ipcalc -n "$remote"/"$remote_netmask_bits"` remote_network="${remote_network#*=}" # add the stuff that doesn't change if it's not already there grep -q '^202 ' /etc/iproute2/rt_tables if [ "$?" -ne 0 ] then echo 202 vpn.out >> /e...
Shell
#!/bin/sh # # Bring down vpn routing. # calculate the network address remote_network=`ipcalc -n "$remote"/"$remote_netmask_bits"` remote_network="${remote_network#*=}" # clear routing via VPN ip route del "$remote_network"/"$remote_netmask_bits" via "$5" table vpn.out ip route del table vpnonly.out via "$5" iptabl...
Shell
#!/bin/sh # Sample script to perform OCSP queries with OpenSSL # given a certificate serial number. # If you run your own CA, you can set up a very simple # OCSP server using the -port option to "openssl ocsp". # Full documentation and examples: # http://www.openssl.org/docs/apps/ocsp.html # Edit the following val...
Shell
#!/bin/sh # Copyright (c) 2005-2010 OpenVPN Technologies, Inc. # Licensed under the GPL version 2 # First version by Jesse Adelman # someone at boldandbusted dink com # http://www.boldandbusted.com/ # PURPOSE: This script automatically sets the proper /etc/resolv.conf entries # as pulled down from an OpenVPN server....
Shell
#!/bin/sh # Copyright (c) 2005-2010 OpenVPN Technologies, Inc. # Licensed under the GPL version 2 # First version by Jesse Adelman # someone at boldandbusted dink com # http://www.boldandbusted.com/ # PURPOSE: This script automatically removes the /etc/resolv.conf entries previously # set by the companion script "cl...
Shell
#!/bin/sh #################################### # Tear Down Ethernet bridge on Linux #################################### # Define Bridge Interface br="br0" # Define list of TAP interfaces to be bridged together tap="tap0" ifconfig $br down brctl delbr $br for t in $tap; do openvpn --rmtun --dev $t done
Shell
#!/bin/sh ################################# # Set up Ethernet bridge on Linux # Requires: bridge-utils ################################# # Define Bridge Interface br="br0" # Define list of TAP interfaces to be bridged, # for example tap="tap0 tap1 tap2". tap="tap0" # Define physical ethernet interface to be bridged...
Shell
#!/bin/sh route add -net 10.0.0.0 netmask 255.255.255.0 gw $5
Shell
#!/bin/sh # stop all openvpn processes killall -TERM openvpn
Shell
#!/bin/sh # A Sample OpenVPN-aware firewall. # eth0 is connected to the internet. # eth1 is connected to a private subnet. # Change this subnet to correspond to your private # ethernet subnet. Home will use HOME_NET/24 and # Office will use OFFICE_NET/24. PRIVATE=10.0.0.0/24 # Loopback address LOOP=127.0.0.1 # De...
Shell
#!/bin/sh # A sample OpenVPN startup script # for Linux. # openvpn config file directory dir=/etc/openvpn # load the firewall $dir/firewall.sh # load TUN/TAP kernel module modprobe tun # enable IP forwarding echo 1 > /proc/sys/net/ipv4/ip_forward # Invoke openvpn for each VPN tunnel # in daemon mode. Alternative...
Shell
#!/bin/sh route add -net 10.0.1.0 netmask 255.255.255.0 gw $5
Shell
#!/bin/sh # # Build an OpenVPN plugin module on *nix. The argument should # be the base name of the C source file (without the .c). # # This directory is where we will look for openvpn-plugin.h CPPFLAGS="${CPPFLAGS:--I../../../include}" CC="${CC:-gcc}" CFLAGS="${CFLAGS:--O2 -Wall -g}" $CC $CPPFLAGS $CFLAGS -fPIC -...
Shell
#!/bin/sh # # Build an OpenVPN plugin module on *nix. The argument should # be the base name of the C source file (without the .c). # # This directory is where we will look for openvpn-plugin.h CPPFLAGS="${CPPFLAGS:--I../../../include}" CC="${CC:-gcc}" CFLAGS="${CFLAGS:--O2 -Wall -g}" $CC $CPPFLAGS $CFLAGS -fPIC -...
Shell
#!/bin/sh # # Build an OpenVPN plugin module on *nix. The argument should # be the base name of the C source file (without the .c). # # This directory is where we will look for openvpn-plugin.h CPPFLAGS="${CPPFLAGS:--I../../..}" CC="${CC:-gcc}" CFLAGS="${CFLAGS:--O2 -Wall -g}" $CC $CPPFLAGS $CFLAGS -fPIC -c $1.c &...
Shell
#!/bin/sh # # Run this script to set up a test CA, and test key-certificate pair for a # server, and various clients. # # Copyright (C) 2014 Steffan Karger <steffan@karger.me> set -eu command -v openssl >/dev/null 2>&1 || { echo >&2 "Unable to find openssl. Please make sure openssl is installed and in your path."; exi...
Shell
#!/bin/sh # # openvpn This shell script takes care of starting and stopping # openvpn on RedHat or other chkconfig-based system. # # chkconfig: 345 24 76 # # description: OpenVPN is a robust and highly flexible tunneling application \ # that uses all of the encryption, authentication, a...
Shell
#!/bin/sh ### BEGIN INIT INFO # Provides: openvpn # Required-Start: $network # Required-Stop: $network # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Short-Description: This shell script takes care of starting and stopping OpenVP...
Shell
#!/bin/sh # # CA - wrapper around ca to make it easier to use ... basically ca requires # some setup stuff to be done before you can use it and this makes # things easier between now and when Eric is convinced to fix it :-) # # CA -newca ... will setup the right stuff # CA -newreq ... will generate a certific...
Shell
#!/bin/sh # set -e export LANG=C export LC_ALL=C PROGDIR=$(dirname "$0") PROGNAME=$(basename "$0") panic () { echo "ERROR: $@" exit 1 } VERBOSE=1 # Dump message is $VERBOSE >= $1 # $1+: message. dump_n () { local LOG_LEVEL=$1 shift if [ "$VERBOSE" -ge "$LOG_LEVEL" ]; then printf "%s\n" "$@" fi } #...
Shell
#!/bin/bash # # Copyright (C) 2010 The Android Open Source Project # # 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 a...
Shell
#!/bin/sh if [ "$1" = "" ]; then key=../apps/server.pem else key="$1" fi if [ "$2" = "" ]; then cert=../apps/server.pem else cert="$2" fi ssltest="adb shell /system/bin/ssltest -key $key -cert $cert -c_key $key -c_cert $cert" if adb shell /system/bin/openssl x509 -in $cert -text -noout | fgrep 'DSA Public Key...
Shell
#!/bin/bash # # Copyright (C) 2010 The Android Open Source Project # # 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 a...
Shell
#!/bin/sh /bin/rm -f mttest purify cc -DSOLARIS -I../../include -g mttest.c -o mttest -L../.. -lthread -lssl -lcrypto -lnsl -lsocket
Shell
#!/bin/sh /bin/rm -f mttest cc -p -DSOLARIS -I../../include -g mttest.c -o mttest -L/usr/lib/libc -ldl -L../.. -lthread -lssl -lcrypto -lnsl -lsocket
Shell
#!/bin/sh # # build using pthreads where it's already built into the system # /bin/rm -f mttest gcc -DPTHREADS -I../../include -g mttest.c -o mttest -L../.. -lssl -lcrypto -lpthread
Shell