chore: install.sh: some edits to make it work with sudo & su (close #242)

This commit is contained in:
M0Rf30 2022-12-10 23:19:56 +01:00
parent ac87fda61d
commit 458d094588
1 changed files with 7 additions and 4 deletions

View File

@ -3,7 +3,7 @@
CURRENT_UID="$(id -u)"
if [ "$CURRENT_UID" -ne 0 ]; then
echo "Please run using sudo!"
echo "Please run as root!"
exit 1
fi
@ -12,13 +12,16 @@ if [ "$USE_SYMLINK" = "true" ]; then
else
cp -v 51-android.rules /etc/udev/rules.d/51-android.rules
fi
chmod a+r /etc/udev/rules.d/51-android.rules
if [ "$USE_GROUP" = "false" ]; then
mkdir -p /usr/lib/sysusers.d/ && sudo cp android-udev.conf /usr/lib/sysusers.d/
install -Dm644 android-udev.conf \
/usr/lib/sysusers.d/android-udev.conf
systemd-sysusers
else
groupdel adbusers
groupadd adbusers
getent group 'adbusers' >/dev/null ||
groupadd -f 'adbusers'
fi
usermod -a -G adbusers "$(logname)"