Commit Graph

47 Commits (a3ae37b385f43c910e31329dc04eea1b85c0af07)

Author SHA1 Message Date
Alex Thiessen 7a83c56d3a
plugins/base: Detect HTTP errors in `myip()`
Out of the box, `curl` reports success (via exit code) even if the
server returns an error, e.g. _429 Too Many Requests_ which was
sometimes the case with `http://myip.dnsomatic.com`. So, errors went
undetected.

There is the `--fail` switch which enables us to use the exit code the
way we need:

> -f, --fail
>        (HTTP) Fail  silently  (no  output  at  all)  on  server
>        errors. This is mostly done to better enable scripts etc
>        to better deal with failed  attempts.  In  normal  cases
>        when  an  HTTP  server  fails  to deliver a document, it
>        returns an HTML document stating so  (which  often  also
>        describes  why  and  more).  This flag will prevent curl
>        from outputting that and return error 22.

Use it to make the `myip()` deliver results reliably.
2020-04-07 00:01:09 +02:00
jayme 20a8f10102 added `-L` to curl options to avoid empty responses
- changed URL to non-www as well
2017-07-28 16:36:57 -04:00
MaYuming 7006261b42 fix ips issue #998 2017-07-08 11:12:07 +08:00
MaYuming e687857eb0 fix ips issue #998 2017-07-06 14:50:53 +08:00
MaYuming d88b068363 fix mkcd issue 2017-06-30 20:14:32 +08:00
MaYuming 6be02f8062 Revert "mkcd one or more dirs"
This reverts commit f369efe953.
2017-06-30 20:09:22 +08:00
MaYuming f369efe953 mkcd one or more dirs 2017-06-30 18:45:22 +08:00
MaYuming f19a8b88eb Revert "fix mkcd issue #993"
This reverts commit 8816edd805.
2017-06-30 18:27:43 +08:00
MaYuming 8816edd805 fix mkcd issue #993 2017-06-30 17:05:03 +08:00
MaYuming c52eb6456c Merge branch 'master' of https://github.com/Bash-it/bash-it 2017-06-28 13:02:30 +08:00
MaYuming a9a9ff74ba fix and Strengthen the command myip 2017-06-28 13:02:21 +08:00
Nils Winkler 6f26f92c97 Fixed checks for enabled files in existing plugins 2017-06-24 17:31:30 +02:00
Thomas Bouve 3a347083d2 Added quotes and fixed missing du depth value. 2016-08-08 09:53:07 +02:00
Thomas Bouve c204a43305 OS X fix for usage function. 2016-08-06 21:53:34 +02:00
Nils Winkler 578e6bbe31 Merge pull request #555 from mimoralea/master
Add mkcd and del functions
2015-10-08 08:09:46 +02:00
Miguel Morales ca3f1baf80 Add del function to the base plugins 2015-10-07 15:55:38 -05:00
Nils Winkler 74a9f5c411 Moved some functions
Some functions were specific to OS X, but were defined in the `base` plugin. I have moved them to the `osx` plugin:

* pman
* pcurl
* pri

As for `pcurl`, the `osx` plugin already had an existing `prevcurl` function, which was doing the same thing. I've aliased `pcurl` to simply call `prevcurl` to avoid breaking existing installations.

As far as I know the `open -fa $PREVIEW` thing only works on OS X, which means that these functions have only worked on OS X anyway.
2015-08-31 08:52:57 +02:00
Antti Ahti fcbe9aa751 Fix ips command for platforms without ifconfig 2015-06-05 15:40:58 +03:00
Ivan Povalyukhin f1de827622 [tests] added test for base plugin mkcd(); make mkcd() safe for directory names starting with a dash 2015-05-03 18:11:18 -07:00
Ivan Povalyukhin f420560986 make buf() to respect file attributes on file backup 2015-04-11 15:51:26 -07:00
Ivan Povalyukhin 10ea42dc75 whitespace fixes in base.plugin.bash 2015-03-29 14:02:31 -07:00
Sam Morrison 4ce1f6f771 rename local variable passgen back to pass 2015-01-20 18:46:44 +09:00
Sam Morrison bfe25807a7 using bash-it boolean check convention 2015-01-19 13:05:46 +09:00
Sam Morrison f1f250f7b8 corrected passgen example text and default 2015-01-19 12:28:35 +09:00
Sam Morrison 5963249c0a Rename function pass to passgen. Define alias pass if pass command (password store) is not installed or BASH_IT_LEGACY_PASS is true. 2015-01-19 12:15:26 +09:00
oxnz c3c40e506b fix bugs caused by unquoted variable(s); remove unnecessary grep in ips func 2014-12-08 00:32:53 +08:00
Travis Swicegood e0c48b1637 Merge pull request #315 from Jeraimee/master
Updating function declarations to avoid parse errors in some bash versions
2014-07-30 08:42:03 -05:00
Jeraimee Hughes f82e66140d Updating function declarations to avoid parse errors in some bash versions. 2014-07-29 08:52:23 -04:00
jimmynotjim 55a37ad4c9 Fixed example arguments and added param arguments 2013-12-19 10:21:55 -05:00
jimmynotjim d5bfb7fcb4 Added plugin to create iso from current dir
Includes options for custom name, dest dir and source dir
2013-11-29 14:25:47 -05:00
Erich Smith 339cfe9733 conditionally define t()
if user has enabled the todo plugin, skip defining the 'one thing'
todo function t().
2012-05-17 21:43:57 -04:00
Erich Smith dd9fb1009b conditionally define t()
if user has installed the todo plugin, forego defining the 'one thing'
todo function t().
2012-05-17 21:40:08 -04:00
Erich Smith 08e439c4f0 update plugin management 2012-05-13 22:13:54 -04:00
Erich Smith 55e77deac1 standardize plugins, update metadata
add about-plugin metadata
chmod -x plugins
cleanup filenames to standardize on x.plugin.bash format
only plugin files intended to be executable from the command line should
contain a shebang line, and should be a+x.
2012-05-13 22:13:54 -04:00
Erich Smith 254d4459e2 basic plugin management
move plugin management functions into 'lib' group in helpers.bash
2012-05-13 22:13:54 -04:00
Erich Smith f5badb3c28 add todo.txt-cli as a plugin
Since it is referenced in the default .bash_profile and in aliases and
themes, why not make it an official plugin?

This creates a 'todo/' directory in /plugins/available, and installs
todo.sh and friends there.  Tab completion and the 't' alias should work
out of the box.

Note: it was also necessary to modify .gitignore to ignore the files
todo.sh generates in custom/.
2012-05-09 19:37:37 -04:00
Erich Smith 248eb30e00 plugin-specific metadata
cite about-plugin metadata.  This could be retrieved later, say by an
install script or other helper function, with:

cat ~/.bash_it/plugins/enabled/base.plugin.bash | metafor about-plugin

In this way, summaries of each plugin may be provided to give newcomers
(like me!) an overview.

also, rewrote plugins-help(), which didn't work very well on my system.
It now dynamically queries composure metadata.
2012-05-08 23:40:24 -04:00
Erich Smith 5d32cf9a02 quote examples
prevent bash expansion and parsing of example code
2012-05-07 12:51:10 -04:00
Erich Smith 2086a053df fix typo 2012-04-28 10:40:16 -04:00
Erich Smith e3011c5ead more portable pass function 2012-04-28 10:35:01 -04:00
Erich Smith a3c3caa0ab help metadata for base plugin 2012-04-28 00:43:38 -04:00
Eitan Adler 3fc60b5358 Fix bogus bash binary location 2012-04-17 00:24:58 -04:00
Travis Swicegood ea0dc44c53 Switch to echo -e and use echo safe colors (fixes: #96) 2012-01-26 08:18:59 -06:00
Mark Szymanski ba8fde85eb Make gshuf alias checker work on other bash versions 2011-08-12 16:30:55 -05:00
Mark Szymanski 576434048b Add simple password generator 2011-08-10 18:49:20 -05:00
Mark Szymanski 4898fa9119 Add pmdown function for previewing markdown files 2011-05-27 11:47:55 -05:00
Travis Swicegood ffa45b0391 Create the concept of enabled plugins
This allows users to disable a plugin without completely removing it.
Instead, they simply remove the `plugins/enabled/*.bash` file for the
plugin they want to disable.  This continues the concept of "everything
on" while providing greater flexibility to future users.

It might be a good idea to allow turning these off by default in the
future and allowing not only the `plugins/enabled/*.bash` files but also
an array of `<plugin_name>` values that would search for
`plugins/available/<plugin_name>.plugin.bash` to enable them.  That
method would make it easier for people custom tune their plugins from
within their `.bash_profile` script.
2011-05-02 23:12:50 -05:00