[英]How to execute “make; make install” inside a bash script?
我需要在bash腳本中自動安裝NRPE代理。 如何在遠程目錄中“進行;進行安裝”? 到目前為止的代碼如下:
#!/bin/bash
for f in *.tar.gz
do
tar zxf "$f" -C /home/$USER/
done
sudo useradd -s /sbin/nologin -M nagios
/home/$USER/nagios-plugins-2.2.1/configure --enable-command-args --with-nagios-user=nagios --with-nagios-group=nagios --with-ssl=/usr/bin/openssl --with-ssl-lib=/usr/lib64/
因此,在“配置”部分結束后,我需要執行“ make; make install”。 另外,有什么方法可以優化當前腳本?
這可能有助於Khanna111的提示 :
cd /home/$USER/nagios-plugins-2.2.1 || exit 1
configure <options> && make && sudo make install
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.