Skip to content

Commit

Permalink
execution of rip via udev rules now uses arm user
Browse files Browse the repository at this point in the history
  • Loading branch information
shitwolfymakes committed May 18, 2022
1 parent e8f8085 commit d004ec1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 0 additions & 6 deletions scripts/docker/docker_arm_wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ eval $(parse_yaml /etc/arm/config/arm.yaml "CONFIG_")
# ID_CDROM_MEDIA_BD = Bluray
# ID_CDROM_MEDIA_CD = CD
# ID_CDROM_MEDIA_DVD = DVD

if [ "$ID_CDROM_MEDIA_DVD" == "1" ]; then
if [ "$CONFIG_PREVENT_99" != "false" ]; then
numtracks=$(lsdvd /dev/"${DEVNAME}" 2> /dev/null | sed 's/,/ /' | cut -d ' ' -f 2 | grep -E '[0-9]+' | sort -r | head -n 1)
Expand All @@ -46,20 +45,15 @@ if [ "$ID_CDROM_MEDIA_DVD" == "1" ]; then
fi
fi
echo "[ARM] Starting ARM for DVD on ${DEVNAME}" | logger -t ARM -s

elif [ "$ID_CDROM_MEDIA_BD" == "1" ]; then
echo "[ARM] Starting ARM for Bluray on ${DEVNAME}" | logger -t ARM -s

elif [ "$ID_CDROM_MEDIA_CD" == "1" ]; then
echo "[ARM] Starting ARM for CD on ${DEVNAME}" | logger -t ARM -s

elif [ "$ID_FS_TYPE" != "" ]; then
echo "[ARM] Starting ARM for Data Disk on ${DEVNAME} with File System ${ID_FS_TYPE}" | logger -t ARM -s

else
echo "[ARM] Not CD, Bluray, DVD or Data. Bailing out on ${DEVNAME}" | logger -t ARM -s
exit #bail out

fi

/usr/bin/python3 /opt/arm/arm/ripper/main.py -d "${DEVNAME}" | logger -t ARM -s
2 changes: 1 addition & 1 deletion setup/51-docker-arm.rules
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ID_CDROM_MEDIA_BD = Bluray
# ID_CDROM_MEDIA_DVD = DVD
# ID_CDROM_MEDIA_CD = CD
ACTION=="change", SUBSYSTEM=="block", RUN+="/opt/arm/scripts/docker/docker_arm_wrapper.sh %k"
ACTION=="change", SUBSYSTEM=="block", RUN+="/sbin/setuser arm /opt/arm/scripts/docker/docker_arm_wrapper.sh %k"

0 comments on commit d004ec1

Please sign in to comment.