【问题标题】:Select yes in the terminal via Bash when using iptables-save使用 iptables-save 时通过 Bash 在终端中选择是
【发布时间】:2017-07-31 23:34:32
【问题描述】:

当我运行这个时:

sudo iptables-save > /etc/iptables/rules.v4

我在终端内得到一个弹出窗口。它问:

Save current IPv4 rules?││││<Yes><No>

我如何强制是?换句话说,iptables-save 有 -y 吗?

或者有什么我可以添加到我的 bash 脚本中以选择是的吗?

【问题讨论】:

    标签: bash iptables


    【解决方案1】:

    我尝试了这个解决方案:https://askubuntu.com/questions/339790/how-can-i-prevent-apt-get-aptitude-from-showing-dialogs-during-installation/340846,它似乎有效。

    echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections
    echo iptables-persistent iptables-persistent/autosave_v6 boolean true | sudo debconf-set-selections
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-13
      • 2017-12-07
      • 2021-08-27
      • 2017-08-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多