mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-09-12 11:10:19 +08:00
rewrite install rules script
This commit is contained in:
@@ -1,19 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Check if user is root/running with sudo
|
||||
if [ `whoami` != root ]; then
|
||||
echo Please run this script with sudo
|
||||
exit
|
||||
set -e
|
||||
|
||||
# Check if script is running as root or with sudo
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
echo "Please run this script with sudo"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ORIG_PATH=`pwd`
|
||||
cd `dirname $0`
|
||||
SCRIPT_PATH=`pwd`
|
||||
cd $ORIG_PATH
|
||||
|
||||
if [ "`uname -s`" != "Darwin" ]; then
|
||||
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
|
||||
if [ "$(uname -s)" != "Darwin" ]; then
|
||||
# Install UDEV rules for USB device
|
||||
cp ${SCRIPT_PATH}/99-obsensor-libusb.rules /etc/udev/rules.d/99-obsensor-libusb.rules
|
||||
echo "usb rules file install at /etc/udev/rules.d/99-obsensor-libusb.rules"
|
||||
cp "$SCRIPT_DIR/99-obsensor-libusb.rules" /etc/udev/rules.d/99-obsensor-libusb.rules
|
||||
echo "USB rules file installed at /etc/udev/rules.d/99-obsensor-libusb.rules"
|
||||
fi
|
||||
echo "exit"
|
||||
|
||||
echo "Done"
|
||||
|
||||
Reference in New Issue
Block a user