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

Test regarding which package to download #3

Open
julienmary opened this issue Sep 17, 2019 · 0 comments
Open

Test regarding which package to download #3

julienmary opened this issue Sep 17, 2019 · 0 comments

Comments

@julienmary
Copy link

  echo "** Installing chtcollectd ..."                                                                                                                                  
  if command_exists rpm ; then                                                                                                                                          
    CHTCOLLECT_PACKAGE="chtcollectd_v"$1".rpm"                                                                                                                          
    PACKAGE_CMD="rpm --force"                                                                                                                                           
  elif command_exists dpkg ; then                                                                                                                                       
    CHTCOLLECT_PACKAGE="chtcollectd_v"$1".deb"                                                                                                                          
    PACKAGE_CMD="dpkg"                                                                                                                                                  
  else                                                                                                                                                                  
    echo "Only supporting debian and redhat-based distributions currently" 2>&1 | tee -a /tmp/agent_install_log.txt                                                     
    abort_agent_install                                                                                                                                                 
  fi  

What a strange way to test the distro type ... What if alien is installed on a debian distro ? This depends on rpm. So that at testing rpm presence, you just test if rpm is installed, not the distro type.

It is much better to parse the file /etc/os-release to get some reliable information.

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