Update install_perccli.sh
This commit is contained in:
parent
45c5398b8c
commit
48dea4676f
|
|
@ -58,7 +58,10 @@ if [[ "$PACKAGE_FILE" == *.rpm ]]; then
|
|||
sudo rpm -ivh "$PACKAGE_FILE"
|
||||
INSTALL_SUCCESS=$?
|
||||
else
|
||||
echo "ERROR: 'rpm' command not found. Please install the package manually."
|
||||
# FIX: Explicitly setting INSTALL_SUCCESS=1 if the command is not found
|
||||
echo "ERROR: 'rpm' command not found. This indicates you may be running a Debian-based system (like Ubuntu)."
|
||||
echo "Please install the 'rpm' package manually, or if you are on Debian/Ubuntu, consider installing 'alien' to convert the package."
|
||||
INSTALL_SUCCESS=1
|
||||
fi
|
||||
elif [[ "$PACKAGE_FILE" == *.deb ]]; then
|
||||
echo "Detected DEB package. Trying to install with 'dpkg -i'..."
|
||||
|
|
@ -66,13 +69,17 @@ elif [[ "$PACKAGE_FILE" == *.deb ]]; then
|
|||
sudo dpkg -i "$PACKAGE_FILE"
|
||||
INSTALL_SUCCESS=$?
|
||||
else
|
||||
echo "ERROR: 'dpkg' command not found. Please install the package manually."
|
||||
# FIX: Explicitly setting INSTALL_SUCCESS=1 if the command is not found
|
||||
echo "ERROR: 'dpkg' command not found. Please install the package manager manually."
|
||||
INSTALL_SUCCESS=1
|
||||
fi
|
||||
else
|
||||
echo "ERROR: Found file $PACKAGE_FILE is neither .rpm nor .deb. Manual installation is required."
|
||||
INSTALL_SUCCESS=1
|
||||
fi
|
||||
|
||||
# 5. Cleanup and Verification
|
||||
# The cleanup step now correctly checks the INSTALL_SUCCESS status.
|
||||
if [ $INSTALL_SUCCESS -eq 0 ]; then
|
||||
echo ""
|
||||
echo "5. Installation successful. Cleaning up temporary files."
|
||||
|
|
@ -83,6 +90,7 @@ if [ $INSTALL_SUCCESS -eq 0 ]; then
|
|||
else
|
||||
echo ""
|
||||
echo "5. Installation failed. The archive '$ARCHIVE_NAME' and temporary directory '$TEMP_DIR' are retained for manual debugging."
|
||||
echo "The package file is located at: $PACKAGE_FILE"
|
||||
fi
|
||||
|
||||
# ------------------------------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Reference in New Issue