ros2_rmp/install.sh

20 lines
672 B
Bash
Raw Permalink Normal View History

2023-09-13 08:48:45 +00:00
#!/bin/bash
# Specify the name of your Python script
SCRIPT_NAME="robot_config.py"
# Check if the script exists in the current directory
if [ -f "$SCRIPT_NAME" ]; then
# Check if /usr/local/bin is writable
if [ -w "/usr/local/bin" ]; then
# Copy the script to /usr/local/bin
sudo cp "$SCRIPT_NAME" "/usr/local/bin"
sudo chmod +x "/usr/local/bin/$SCRIPT_NAME"
echo "Script '$SCRIPT_NAME' has been installed in /usr/local/bin."
else
echo "Error: /usr/local/bin is not writable. You may need to use 'sudo' to install the script."
fi
else
echo "Error: Script '$SCRIPT_NAME' not found in the current directory."
fi