I’ll start this with I’m a novice at writing these scripts, so it could be something obvious.
I’ve got a bash script worklet mostly working to install the Tanium client to RHEL/CentOS servers, but am running into an issue when it needs to copy a file to a directory created after the install. It seemly does everything else properly when I run it, except copy the tanium-init.dat file. I confirmed it properly extracts it to /tmp from the tarball payload as well. I thought adding the pause may help in case it was trying to copy it before the directory was created, but that doesn’t seem to be the case.
# Copies the tarball to /tmp
scp TaniumClient-184.108.40.2065.tar.gz /tmp
# Extracts the tarball to /tmp
tar xvzf /tmp/TaniumClient-220.127.116.115.tar.gz -C /tmp
# Installs the Tanium client, outputs install log to /tmp
sudo rpm -i /tmp/TaniumClient-18.104.22.1685-1.rhe7.x86_64.rpm > /tmp/taniumclient_install.log
# Sets the Tanium Client Server info
sudo /opt/Tanium/TaniumClient/TaniumClient config set ServerName *servername*
# Copies the tanium-init.dat to the TaniumClient directory
sleep 15 && sudo cp /tmp/tanium-init.dat /opt/Tanium/TaniumClient/tanium-init.dat
# Enable to the Tanium client service to start at boot then start the service
sudo systemctl enable taniumclient
sudo systemctl start taniumclient