learning shell check host dependent pkg】的更多相关文章

[Purpose]        Shell script check host dependent pkg   [Eevironment]        Ubuntu 16.04 bash env   [Procdeure] Source code:  dependent_pkg="gitk" for pkg in $dependent_pkg; do if ! dpkg-query -l $pkg | grep -q ii; then echo installing $pkg ..…
[Purpose]        Shell script check requires root privileges   [Eevironment]        Ubuntu 16.04 bash env   [Procdeure] Source code:  #!/bin/bash ]]; then echo "This script requires root privileges, trying to use sudo" sudo "test.sh" &…
Shell built-in variables [Purpose]        Learning shell built-in variables, example $0,$1,$2,$3,$#,$$,$*,$@,$-,$?   [Eevironment]        Ubuntu 16.04 bash env   [Procdeure] Source code: #!/bin/bash echo "shell args option" echo "script nam…
如果你拥有一个网站,那么最重要的事情就是要保证它24小时都能够访问.不过国内的虚拟主机服务非常糟糕,经常会出现各种状况,所以我们需要一个软件,可以让我们第一时间知道网站出现了无法访问的情况,从而通知售后人员解决.而Check Host就是这么一个windows下的免费网站时时监控工具. 服务器无法访问,那么对网站是非常不利的,而搜索引擎也会知道这个状况,因为蜘蛛不能爬行你的网页了.所以对访客以及搜索引擎排名都是不利的.不过这个事情肯定会发生,我们能做的就是提高反应速度,让这样的情况在最短的时间内…
the host may be down,or there may be a problem with the network connection. Sometimes such problems can also be caused by a misconfigured firewall. 遇到这样的问题可能有这几个情况: 1.在安装centos的时候没安装ssh 2.sshd_config与ssh_config配置问题 3.IP问题 4.防火墙问题 一.安装CentOS  SSH yum…
Shell script prompt to run with superuser privileges [Purpose]        Check whether have root privileges to run script   [Eevironment]        Ubuntu 16.04 bash env   [Procdeure] Source code: #!/bin/bash ]]; then echo "This script requires root privil…
Shell args handing key=value example [Purpose]        Learning how to handing ker=value args   [Eevironment]        Ubuntu 16.04 bash env   [Procdeure]        Source code: # Script parameters handling get left parameters and right value for i in "$@&…
shell result from cmdline echo $? if 0 then success ;else failure (shell 执行每部返回值,rm -rf 错误,打包不能覆盖) 解决sudo: sorry, you must have a tty to run sudo   前几天遇到一个问题,在一个终端中调用另一个shell,始终是无法执行的,后来捕捉到报错信息为sudo: sorry, you must have a tty to run sudo,后来,在网上了解到可以…
[Purpose]        Shell print function base on err info wrn ext output level   [Eevironment]        Ubuntu 16.04 bash env   [Procdeure] Source code: #!/bin/bash DEST=/tmp mkdir -p /tmp/debug display_alert() #-------------------------------------------…
Shell get script absolute path [Purpose]        Get shell script absolute path   [Eevironment]        Ubuntu 16.04 bash env   [Procdeure] Source code: #!/bin/bash echo "$(dirname "$(realpath "${BASH_SOURCE}")")" echo "$(…