Get the App
SLTechnology News&Howtos  ›  Development  › 

How to deploy hosts in Linux Environment

Shulou Source: shulou.com Published: 2022-06-03 11:05:40 10月27日 Update

Editor to share with you how to deploy hosts under the Linux environment, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

One-click deployment script for hosts in Linux environment, contributed by @ lstoars; @ fluviusmagnus provides an enhanced version.

Official website: https://github.com/racaljk/hosts/tree/master/hosts_tools

#! / bin/sh## script_tool_for_linux## Use command: `sudo sh script_tool_for_ linux.sh` or# `su-c'sh script_tool_for_linux.sh' `# to update your hosts file.## WARNING: the script CAN NOT replace others' hosts rules.# If you have hosts rules provided by others, you may get conflict.#if [`id-u`-eq 0] Then curl-fLo / tmp/fetchedhosts' https://raw.githubusercontent.com/racaljk/hosts/master/hosts' sed-I'/ # Copyright (c) 2014 Modified hosts end/d' / etc/hosts sed-I "s/localhost/ `hostname` / g" / tmp/fetchedhosts cat / tmp/fetchedhosts > > / etc/hosts rm-f / tmp/fetchedhosts echo 'Success.'else echo' Permission denied, are you root?'fi is all the content of the article "how to deploy hosts in Linux" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Environment article content not much most official official website more version knowledge website script industry contribution information information channel channel one click reference learning Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Apple macOS Shulou Technology Microsoft