Skip to content

Commit

Permalink
full uninstall
Browse files Browse the repository at this point in the history
  • Loading branch information
alireza787b committed Aug 26, 2024
1 parent 57895d6 commit cd91768
Showing 1 changed file with 27 additions and 12 deletions.
39 changes: 27 additions & 12 deletions setup/setup_px4_sitl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,20 @@ MAVLINK_ROUTER_COMMAND="mavlink-routerd -e IP_PLACEHOLDER:14540 -e IP_PLACEHOLDE
# === Repair Mode (Configurable) ===
REPAIR_MODE=false # Set to true if you always want full repair mode



# === Check for Custom Installation Directory Parameter ===
if [ -n "$1" ]; then
INSTALL_PATH="$1"
CLONE_PATH="$INSTALL_PATH/PX4-Autopilot-Me"
CONFIG_FILE="$INSTALL_PATH/.px4sitl_config"
else
INSTALL_PATH="$DEFAULT_CLONE_PATH"
CLONE_PATH="$INSTALL_PATH/PX4-Autopilot-Me"
CONFIG_FILE="$DEFAULT_CONFIG_FILE"
fi


# === Flags and Arguments ===
REPAIR_MODE_FLAG="--repair"
UNINSTALL_FLAG="--uninstall"
Expand All @@ -101,7 +115,7 @@ if [[ "$1" == "$REPAIR_MODE_FLAG" ]]; then
shift
elif [[ "$1" == "$UNINSTALL_FLAG" ]]; then
# Uninstall the global access command
echo "Uninstalling global access for px4xplane..."
echo "Uninstalling global access for px4xplane..."
if [ -L "$HOME/bin/px4xplane" ]; then
rm "$HOME/bin/px4xplane"
echo "Removed global command from $HOME/bin."
Expand All @@ -111,19 +125,20 @@ elif [[ "$1" == "$UNINSTALL_FLAG" ]]; then
else
echo "Global command not found."
fi
echo "Uninstallation complete."
exit 0
if [ -L "$CLONE_PATH" ]; then
sudo rm -rf "$CLONE_PATH"
echo "Removed PX4-Autopilot-Me Cloned Repository."
fi
if [ -L "$CONFIG_FILE" ]; then
rm "$CONFIG_FILE"
echo "Removed px4sitl_config file."
fi
fi

# === Check for Custom Installation Directory Parameter ===
if [ -n "$1" ]; then
INSTALL_PATH="$1"
CLONE_PATH="$INSTALL_PATH/PX4-Autopilot-Me"
CONFIG_FILE="$INSTALL_PATH/.px4sitl_config"
else
INSTALL_PATH="$DEFAULT_CLONE_PATH"
CLONE_PATH="$INSTALL_PATH/PX4-Autopilot-Me"
CONFIG_FILE="$DEFAULT_CONFIG_FILE"


echo "Uninstallation complete."
exit 0
fi

# === Create Parent Directory if Needed ===
Expand Down

0 comments on commit cd91768

Please sign in to comment.