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

RPM name changed #25

Merged
merged 2 commits into from
Aug 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions install-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,11 @@ get_os_major_version_id () {
do_rpm_install(){
get_package "rpm"
sleep 2
if rpm -q cyral-sidecar > /dev/null 2>&1; then
if rpm -q cyral-sidecar > /dev/null 2>&1 || rpm -q sidecar > /dev/null 2>&1; then
echo "Removing existing installation..."
# Split this call in 2 because rpm wont uninstall any package if one or more dont exist
rpm -e --erase cyral-sidecar > /dev/null 2>&1
rpm -e --erase sidecar > /dev/null 2>&1
rm -f "$(grep "discovery-database" /etc/cyral/cyral-service-monitor/config.yaml 2>/dev/null| awk '{print $2}')"
rm -f /etc/cyral/conf.d/sidecar.db
fi
Expand All @@ -116,9 +118,9 @@ do_rpm_install(){
do_dpkg_install(){
get_package "deb"
sleep 2
if dpkg -s cyral-sidecar > /dev/null 2>&1; then
if dpkg -s cyral-sidecar > /dev/null 2>&1 || dpkg -s sidecar > /dev/null 2>&1; then
echo "Removing existing installation..."
dpkg -r cyral-sidecar > /dev/null 2>&1
dpkg -r cyral-sidecar sidecar > /dev/null 2>&1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if one of these packages are not present in the system, wont this command fail?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with the -r option it continues:

sudo dpkg -r cyral-sidecar sidecar
dpkg: warning: ignoring request to remove cyral-sidecar which isn't installed
(Reading database ... 67831 files and directories currently installed.)
Removing sidecar (4.14.6-alpha) ...
Removed "/etc/systemd/system/multi-user.target.wants/cyral-alerter.service".
Removed "/etc/systemd/system/multi-user.target.wants/cyral-authenticator.service".
Removed "/etc/systemd/system/multi-user.target.wants/cyral-certificate-manager.service".
Removed "/etc/systemd/system/multi-user.target.wants/cyral-dispatcher.service".
Removed "/etc/systemd/system/multi-user.target.wants/cyral-forward-proxy.service".
Removed "/etc/systemd/system/multi-user.target.wants/cyral-oracle-wire.service".
Removed "/etc/systemd/system/multi-user.target.wants/cyral-pg-wire.service".
Removed "/etc/systemd/system/multi-user.target.wants/cyral-push-client.service".
Removed "/etc/systemd/system/multi-user.target.wants/cyral-service-monitor.service".
Removed "/etc/systemd/system/multi-user.target.wants/cyral-sqlserver-wire.service".

rm -f "$(grep "discovery-database" /etc/cyral/cyral-service-monitor/config.yaml 2>/dev/null| awk '{print $2}')"
rm -f /etc/cyral/conf.d/sidecar.db
fi
Expand Down
Loading