DNSSEC 重新注册 shell 脚本困难重重

DNSSEC resigining shell script struggles

我请求帮助,如果有人能帮助我解决我的 shellscript 问题,我将不胜感激。下面的代码是我用来退出区域文件的 shellscript。

#!/bin/bash
hash=$(head -c 1000 /dev/random | sha1sum | cut -b 1-16)
command=$(dnssec-signzone -3 $hash –N 'KEEP' –o "owolf.dnssec.local" –t /etc/bind/zones/db.owolf.dnssec.local)
sleep 10
service bind9 reload

当我手动启动脚本时,出现了两个错误,我不知道为什么。

第一个错误: !/bin/bash: 没有那个文件或目录

我检查过 bash 存在于目录 /bin 中。

第二个错误: -N 无法打开文件。

引用似乎有误,但我已经尝试过 ",' 和 ´ none 它们都有效。

我还尝试了什么? 我还尝试并确保以 unix 样式转换行结尾,并且文件中没有其他错放的符号。

已解决 该文件似乎已损坏,创建了一个新文件并手动填写了代码。还修复了一些错误的引号。

#!/bin/bash
hash=$(head -c 1000 /dev/random | sha1sum | cut -b 1-16)
dnssec-signzone -3 "$hash" –N "KEEP" –o "owolf.dnssec.local" –t /etc/bind/zones/db.owolf.dnssec.local
sleep 10
service bind9 reload

文件好像坏了,新建一个文件,手动填入代码。还修复了一些错误的引号。

#!/bin/bash
cd /var/cache/bind/ #Key Material is there
hash=$(head -c 1000 /dev/random | sha1sum | cut -b 1-16)
dnssec-signzone -3 "$hash" –N "KEEP" –o "owolf.dnssec.local" –t /etc/bind/zones/db.owolf.dnssec.local
sleep 10
service bind9 reload

– lt_katana