pluveto / flydav

Setup a tiny webdav server in 30 seconds. Multi-user, path prefix etc. 轻量高效的 WebDav 服务器。
MIT License
113 stars 7 forks source link

Compatibility issues (?) in installer script #10

Open kemege opened 1 year ago

kemege commented 1 year ago

When I run

curl -sL https://raw.githubusercontent.com/pluveto/flydav/main/scripts/installer.sh | sudo bash

in Debian 11.6, I got the following error:

bash: line 129: ARCH: command not found

It turns out that bash identifies the ARCH in $(ARCH) in Line 129 as a command, and changing it to $ARCH seems to resolve the problem.

I'm not quite familiar with bash, but as this script has existed for a long time, perhaps this bug is specific to some new version of bash?

pluveto commented 1 year ago

Try the new version

kemege commented 1 year ago

Thank you for your quick response! The previous problem has been resolved. However, I found another problem when using the command in README. When I use curl to download the script, and use "sudo bash" to run it, everything is fine. However, if I use pipe to run the script, like curl -sL ... | sudo bash, all the places that require user input are skipped automatically, and the script will exit with error. The output will be like this:

$ curl -sL https://raw.githubusercontent.com/pluveto/flydav/main/scripts/installer.sh | sudo bash
Getting latest release from https://api.github.com/repos/pluveto/flydavDownloading flydav v0.2.46 from https://github.com/pluveto/flydav/releases/download/v0.2.46/flydav-app-linux-amd64.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:-  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:-  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  3 4518k    3  159k    0     0   135k      0  0:00:33  0:00:01  0:00:3100 4518k  100 4518k    0     0  2458k      0  0:00:01  0:00:01 --:--:-- 6594k
Downloaded flydav to /tmp/flydav_install/flydav.zip
Archive:  /tmp/flydav_install/flydav.zip
   creating: /tmp/flydav_install/dist/linux_amd64/
  inflating: /tmp/flydav_install/dist/linux_amd64/flydav
Configuration file /etc/flydav/flydav.toml already exists.
Do you want to keep it? (y/n)
Installing binary
Creating user flydav
Creating directory
mkdir: cannot create directory ‘’: No such file or directory
Failed to run mkdir -p
pluveto commented 1 year ago
        I will set up a Debian vm to test it, and thank you for reporting---- On Sat, 2023-02-18 20:24:47  ***@***.***> wrote ----  

Thank you for your quick response!
The previous problem has been resolved. However, I found another problem when using the command in README.
When I use curl to download the script, and use "sudo bash" to run it, everything is fine.
However, if I use pipe to run the script, like curl -sL ... | sudo bash, all the places that require user input are skipped automatically, and the script will exit with error. The output will be like this:
$ curl -sL https://raw.githubusercontent.com/pluveto/flydav/main/scripts/installer.sh | sudo bash
Getting latest release from https://api.github.com/repos/pluveto/flydavDownloading flydav v0.2.46 from https://github.com/pluveto/flydav/releases/download/v0.2.46/flydav-app-linux-amd64.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:- 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:- 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
3 4518k 3 159k 0 0 135k 0 0:00:33 0:00:01 0:00:3100 4518k 100 4518k 0 0 2458k 0 0:00:01 0:00:01 --:--:-- 6594k
Downloaded flydav to /tmp/flydav_install/flydav.zip
Archive: /tmp/flydav_install/flydav.zip
creating: /tmp/flydav_install/dist/linux_amd64/
inflating: /tmp/flydav_install/dist/linux_amd64/flydav
Configuration file /etc/flydav/flydav.toml already exists.
Do you want to keep it? (y/n)
Installing binary
Creating user flydav
Creating directory
mkdir: cannot create directory ‘’: No such file or directory
Failed to run mkdir -p

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

pluveto commented 1 year ago

I think we can download the installer and execute it manually.

curl -sL "https://raw.githubusercontent.com/pluveto/flydav/main/scripts/installer.sh" -o /tmp/flydav-installer.sh
sudo chmod +x /tmp/flydav-installer.sh
sudo bash
sudo rm -f /tmp/flydav-installer.sh