This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin | |
| ### Thanks Xream's Work XD | |
| # if you don't have several vpn servers to select, you can comment following line | |
| # and use your openvpn config file name to replace "${host}.ovpn" in while loop. | |
| read -p "Select the host: " host |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 37 03 00 110415233453 C11 | |
| 110415233416 | |
| ND20110415233435 NCN005 JD////////////// JN/// | |
| 251 N370 E1408 010 66 6+ RK66324 RT01/// RC13/// | |
| EBI 251 S6+6- ////// 11 300 S5+5- ////// 11 250 S5+5- ////// 11 | |
| 310 S0404 ////// 11 311 S0404 ////// 11 252 S0404 ////// 11 | |
| 301 S0404 ////// 11 221 S0404 ////// 01 340 S0404 ////// 01 | |
| 341 S0404 ////// 01 321 S0404 233455 00 331 S0404 233457 10 | |
| 350 S0404 233501 00 360 S0404 233508 00 243 S0403 ////// 01 | |
| 330 S0403 233454 00 222 S0403 233455 00 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # 設定 | |
| API="http://www.vpngate.net/api/iphone/" | |
| msg_info(){ echo -e "${*}"; } | |
| # APIで取得したリストを読み込み | |
| #msg_info "Loading the list of server ..." | |
| CSV="$(curl -sL "${API}" | tr -d '\r')" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # インストールのやり方はこちらのサイトを参考にしました。 | |
| # http://blog.csdn.net/shile/article/details/54602768 | |
| ### まずはbashdbのインストール | |
| # osのバージョンを確認 | |
| [vagrant@daily bashdb-code]$ cat /etc/redhat-release | |
| CentOS release 6.7 (Final) | |
| # アーキテクチャ(OSが32bit, 64bitどちらなのか)を確認 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # Example of how to parse short/long options with 'getopt' | |
| # | |
| OPTS=`getopt -o vhns: --long verbose,dry-run,help,stack-size: -n 'parse-options' -- "$@"` | |
| if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi | |
| echo "$OPTS" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ### | |
| # This is a code example showing how to use getops to parse short options and a | |
| # subcommand with short options of it's own. Based on Kevin Sookocheff's post: | |
| # https://sookocheff.com/post/bash/parsing-bash-script-arguments-with-shopts/ | |
| # | |
| # Please feel free to use it and modify it as you see fit. Any questions and/or | |
| # recommendations are more than welcome. | |
| ### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # Example using getopt (vs builtin getopts) that can also handle long options. | |
| # Another clean example can be found at: | |
| # http://www.bahmanm.com/blogs/command-line-options-how-to-parse-in-bash-using-getopt | |
| # | |
| aflag=n | |
| bflag=n |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Bash `getopts` template | |
| - [Example](#example) | |
| - [Reference](#reference) | |
| ```sh | |
| #!/bin/bash -e | |
| function usage { | |
| cat <<EOF >&2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # File name | |
| readonly PROGNAME=$(basename $0) | |
| # File name, without the extension | |
| readonly PROGBASENAME=${PROGNAME%.*} | |
| # File directory | |
| readonly PROGDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) | |
| # Arguments | |
| readonly ARGS="$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # 下記,よくできた bash マニュアルだと思っていたら,JP1/Advanced Shell というもののマニュアルだった... bash のマニュアルを確認していないので以下はデタラメかもです. | |
| # | |
| # 参考 | |
| # | |
| # getoptコマンド(コマンドラインのオプションを解析する) : JP1/Advanced Shell http://itdoc.hitachi.co.jp/manuals/3021/3021313330/JPAS0337.HTM | |
| # 形式1 |