执行远程 Bash 脚本 fin GitHub 失败

执行远程 Bash 脚本 fin GitHub 失败

我正在尝试使用以下curl 在我的 RaspberryPi 3 型号 B+ 上运行 bash 脚本:

export GITHUB_TOKEN=<my_personal_access_token>

curl -sSL https://${GITHUB_TOKEN}@raw.githubusercontent.com/inmarsat-enterprise/fieldedge-core/main/install.sh | bash 

我也尝试过从sudo apt install dos2unix另一个线程执行 a 操作,但这也因命令而失败:

curl -sSL https://${GITHUB_TOKEN}@raw.githubusercontent.com/inmarsat-enterprise/fieldedge-core/main/install.sh | dos2unix |bash 

bash 脚本“install.sh”包含用户提示,并且它在第一个脚本中吐出,但我不知道如何解决这个问题?

有人可以帮忙吗?

我在 Pi 上看到的错误:

pi@fieldedge:~ $ curl -sSL https://${GITHUB_TOKEN}@raw.githubusercontent.com/inmarsat-enterprise/fieldedge-core/main/install.sh |dos2unix | bash
[FieldEdge INFO] Starting FieldEdge setup...
[FieldEdge INFO] Using GITHUB_TOKEN for secure file access.
[FieldEdge INFO] Updating host system. This may take several minutes...
Hit:1 http://raspbian.raspberrypi.org/raspbian bullseye InRelease
Hit:2 http://archive.raspberrypi.org/debian bullseye InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Continue script installation?
1) Yes
2) No
#? 1) Yes
2) No
#? #? #? #? 1) Yes
2) No
1) Yes
#? #?
pi@fieldedge:~ $

答案1

我不知道问题是什么,因为没有明显的错误,但一个简单的解决方法是将脚本下载到文件中,然后执行该文件而不是使用管道:

curl -sSL https://${GITHUB_TOKEN}@raw.githubusercontent.com/inmarsat-enterprise/fieldedge-core/main/install.sh > install.sh
bash ./install.sh

相关内容