Giter Club home page Giter Club logo

hosts's Issues

brew install says: branch for 3.1.1 is missing

bryan-mbp:~$ brew tap alphabetum/taps && brew install alphabetum/taps/hosts
==> Tapping alphabetum/taps
Cloning into '/usr/local/Homebrew/Library/Taps/alphabetum/homebrew-taps'...
remote: Enumerating objects: 23, done.
remote: Counting objects: 100% (23/23), done.
remote: Compressing objects: 100% (22/22), done.
remote: Total 23 (delta 11), reused 7 (delta 1), pack-reused 0
Unpacking objects: 100% (23/23), done.
Tapped 4 casks and 14 formulae (67 files, 39.7KB).
==> Installing hosts from alphabetum/taps
==> Cloning https://github.com/alphabetum/hosts.git
Cloning into '/Users/btalbot/Library/Caches/Homebrew/hosts--git'...
warning: Could not find remote branch 3.1.1 to clone.
fatal: Remote branch 3.1.1 not found in upstream origin
Error: An exception occurred within a child process:
DownloadError: Failed to download resource "hosts"
Failure while executing; git clone --depth 1 --branch 3.1.1 https://github.com/alphabetum/hosts.git /Users/btalbot/Library/Caches/Homebrew/hosts--git exited with 128. Here's the output:
Cloning into '/Users/btalbot/Library/Caches/Homebrew/hosts--git'...
warning: Could not find remote branch 3.1.1 to clone.
fatal: Remote branch 3.1.1 not found in upstream origin

hosts add does not work

i tried using hosts to add an entry with the exact command

sudo hosts add 0.0.0.0 hassan.dev

this however doest recognise the hostname provided. i've tried alternative hostname, hostname provided as string but still no luck, it simply returns, no matter what arguments i provide to the add command

Please include a hostname
Usage:
  hosts add <ip> <hostname> [comment]

Description:
  Add a given IP address and hostname pair, along with an optional comment.

`hosts remove <hostname> --force` fails

When executing hosts remove <hostname> --force the command fails with No matching records found. however if one executes hosts list you can see the entry is still there.

[SOLVED] error line 1155: EDITOR: variable bounds not set

When editing, it gives an error - line 1155: EDITOR: variable bounds not set.

The problem was solved in the _verify_write_permissions function by adding the -E argument to sudo in line 367

_verify_write_permissions() {
  if [[ ! -w "${HOSTS_PATH}" ]]
  then
    if ((_AUTO_SUDO))
    then
      local _my_path
      _my_path="$(cd "$(dirname "$0")"; pwd)/${_ME}"

      sudo -E "${_my_path}" "${_SUBCOMMAND}" "${_COMMAND_PARAMETERS[@]:-}"
      exit $?
    else
      _exit_1 printf \
"You don't have permission to perform this operation. Try again with:
sudo !!\\n"
    fi
  fi
}

bugs when executing outside of path

I have included the script in a project directory where it is called from a project setup shell script.

Because of this line, on/around line 241, the internal recursive calls to itself fail.
_ME=$(basename "${0}")

This may not be the most elegant fix for it, but this works.

_ME=$(cd "$(dirname "$0")"; pwd)/$(basename "${0}")

This is because the script is trying to call itself without a path.

Not explicitly free software

Thanks for (presumably) releasing this under a free licence!

Unfortunately, there's no indication in hosts that it's free software, or that the LICENSE file here applies to it. This is particularly problematic as users are encouraged to copy/curl it as a stand-alone script.

The short text of LICENSE should be included verbatim as a comment in the script itself, under the copyright notice.

Only prompt for `--auto-sudo` when needed

Consider the following:

hosts add --auto-sudo 127.0.0.1 cdn.cubing.net
sudo -k # clear `sudo`
hosts add --auto-sudo 127.0.0.1 cdn.cubing.net

Since adding a host is idempotent, the second invocation doesn't change the /etc/hosts file, and hosts can tell this without asking for sudo. It would be nice if --auto-sudo was a little smarter and avoided the prompt. (In fact, that was sort of my assumption based on the name.)

The message show when remove entry.

Hello,

Firstly, Thank you for saving the time to manage the host file also when I remove an entry that shows message "sed: can't read : No such file or directory".

[Feature request] Temporary entries with auto-deletion using crontabs

Sometimes you are testing or waiting for some domain to update its DNS and you add your domain to your hosts but often you forgot to delete that entry. I suggest some syntax as parameters to the add command like this:

hosts add --autoremove --time=30m 10.12.13.14 example.com

This command should schedule a crontab job in 30m to run hosts remove example.com

bpkg install does not install package

Here is the command and output:

 bpkg install xwmx/hosts   

    info: Install /xwmx/hosts/master from remote https://raw.githubusercontent.com [https://github.com]
    info: Cloning https://github.com/xwmx/hosts.sh.git to /var/folders/_g/sphjngbn4ms0rxcyys6rt5br0000gn/T/hosts.sh-master

This results in nothing being installed and I cannot figure out why.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.