mmnaseri / nordvpn-reconnect

Reconnector for NordVPN client on Linux
21 stars 4 forks source link

Install script failing to copy the files to destination #2

Closed Dylan-86 closed 2 years ago

Dylan-86 commented 2 years ago

Hi, First of all, THANK YOU for putting this together.

Secondly, I've informed NordVPN of this script and of the underlying issue.

Finally, I've been experiencing issues installing the code.

sudo ./install.sh install

responds with

 - Uninstalling nordvpn-reconnector
   - Removing the executable
   - Removing the symbolic link
   - Removing the service unit definition
 - Installing nordvpn-connector
   - Copying the script to /opt/nordvpn-reconnector
cp: -r not specified; omitting directory '/home/[user]/Downloads/nordvpn-reconnect-main/icon.png'
   - Adding symbolic link at /usr/bin/nordvpn-reconnector
   - Adding symbolic link at /usr/bin/nordvpnd-killer
   - Copying service unit definition for all users
cp: -r not specified; omitting directory '/home/[user]/Downloads/nordvpn-reconnect-main/nordvpnd-killer.service

If then I try any other command, it says that first I need to install with ./install.sh install (which is what I did :) ).

Service unit has not been installed. Please run ./install.sh install first

mmnaseri commented 2 years ago

Thanks a lot for the kind words! And also sorry for not responding earlier, things have been kinda hectic IRL recently.

Okay, that is strange indeed. I am looking at the lines of code for the -r error:

  mkdir -p "${INSTALL_LOCATION}"
  cp "$(pwd)/nordvpn-reconnect.sh" "${INSTALL_LOCATION}"
  cp "$(pwd)/nordvpnd-killer.sh" "${INSTALL_LOCATION}"
  cp "$(pwd)/icon.png" "${INSTALL_LOCATION}"
  chmod +x "${INSTALL_LOCATION}/nordvpn-reconnect.sh"
  chmod +x "${INSTALL_LOCATION}/nordvpnd-killer.sh"

At no point is my script trying to copy a directory. The issue could be that one of the three things I am copying here (i.e. $(pwd)/nordvnn-reconnect.sh, etc.) is a directory on your local? Or the mkdir -p step failed which should have resulted in a different error. Can you verify that the directory at /opt/nordvpn-reconnector exists? And can you verify that what you have at /home/[user]/Downloads/nordvpn-reconnect-main/icon.png is not a directory (the same goes for /home/[user]/Downloads/nordvpn-reconnect-main/nordvpnd-killer.service)?

Dylan-86 commented 2 years ago

Hi! So: Can you verify that the directory at /opt/nordvpn-reconnector exists? YES it does exist


name@name-Inspiron-5502:~$ cd /opt/nordvpn-reconnector 
name@name-Inspiron-5502:/opt/nordvpn-reconnector$ 

And can you verify that what you have at /home/[user]/Downloads/nordvpn-reconnect-main/icon.png is not a directory (the same goes for /home/[user]/Downloads/nordvpn-reconnect-main/nordvpnd-killer.service)?

They ARE directories... Why? I've no clue.

name@name-Inspiron-5502:~/Downloads/nordvpn-reconnect-main$ file ./*
./icon.png:                    directory
./install.sh:                  Bourne-Again shell script, ASCII text executable
./nordvpnd-killer.service:     directory
./nordvpnd-killer.sh:          Bourne-Again shell script, ASCII text executable
./nordvpn-reconnector.service: ASCII text
./nordvpn-reconnect.sh:        Bourne-Again shell script, ASCII text executable
./README.md:                   directory

I have just tried to git clone into a new dir and now everything goes well. The problem seems to be that I downloaded the code as a zip and extracted the files...

No idea why it happened.

Thanks again for your support!

Dy

mmnaseri commented 2 years ago

I'm glad your issue is resolved :D Sometimes weirdness does happen