Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux client installation issues. #909

Open
mattish91 opened this issue Jul 13, 2024 · 1 comment
Open

Linux client installation issues. #909

mattish91 opened this issue Jul 13, 2024 · 1 comment

Comments

@mattish91
Copy link

Describe the bug
When installing the Linux persistent client i get errors with line 15 - 29 "Unexpected "(" " When commented out, the client installs fine.

To Reproduce

  1. Download the Linux persistent script "Install-Ubuntu-x64.sh" on your target client that should be connected to your remotely server.
  2. Set permissions in order to run the script
  3. Run the script to find the error.

Remotely Version
Server (can be found on about page): 2024.02.23.1927
Agent (can be found in device card): 2024.02.23.1927

Expected Behavior
Install client without these errors and without having to modify the script in any way before running it.

Screenshots
Will add next time i add a Linux server to my fleet.

Desktop (please complete the following information):

  • OS: Linux
  • Browser: Not applicable
  • Version: Not applicable

Additional Context
To be precise this is what's needed to be commented out in order to run the script and get a successful installation on my Ubuntu 22.04 LTS machine:

# Args=( "$@" )
# ArgLength=${#Args[@]}

# for (( i=0; i<${ArgLength}; i+=2 ));
# do
#    if [ "${Args[$i]}" = "--uninstall" ]; then
#        systemctl stop remotely-agent
#        rm -r -f $InstallDir
#        rm -f /etc/systemd/system/remotely-agent.service
#        systemctl daemon-reload
#        exit
#    elif [ "${Args[$i]}" = "--path" ]; then
#        UpdatePackagePath="${Args[$i+1]}"
#    fi
#done

I also can't remember i have had to comment this out before, could it be something Distro related? (Just a fresh install of Ubuntu Server LTS "ubuntu-22.04.4-live-server-amd64.iso" just like before, same ISO that i have always used no updates installed).

@mattish91
Copy link
Author

mattish91 commented Jul 13, 2024

This was somewhat of a hassle, but i made it in the end. Maybe someone more experienced with github and has more knowledge on where this should be commited could do so?

EDIT: See commit #910

Original from the file "Install-ubuntu-x64.sh" from line 15-34:

Args=( "$@" )
ArgLength=${#Args[@]}

for (( i=0; i<${ArgLength}; i+=2 ));
do
    if [ "${Args[$i]}" = "--uninstall" ]; then
        systemctl stop remotely-agent
        rm -r -f $InstallDir
        rm -f /etc/systemd/system/remotely-agent.service
        systemctl daemon-reload
        exit
    elif [ "${Args[$i]}" = "--path" ]; then
        UpdatePackagePath="${Args[$i+1]}"
    fi
done

if [ -z "$ETag" ]; then
    echo  "ETag is empty.  Aborting install." | tee -a $LogPath
    exit 1
fi

My working change for both Ubuntu 22.04.4 - 24.04.0 from line 15-35:

while [ $# -gt 0 ]; do
    case "$1" in
        --uninstall)
            echo "Uninstalling..."
            systemctl stop remotely-agent
            rm -r -f $InstallDir
            rm -f /etc/systemd/system/remotely-agent.service
            systemctl daemon-reload
            echo "Uninstall completed successfully!"
            exit
            ;;
        --path)
            UpdatePackagePath="$2"
            shift
            ;;
        *)
            echo "Unknown argument: $1"
            ;;
    esac
    shift
done

Maybe someone could review this and confirm it's working?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant