Skip to content

Commit a5ac2f5

Browse files
caprielealberto.petrucciFrancYescO
authored
Feature/transmission trigger (#1082)
* Updated transmission installation script to create hot reload file + fixed rpc_whitelist * little cleanup * Restart transmission only if there are no usb plugged * Restart transmission only if the attached usb has the sharing/transmission directory * Fixed wrong path * Updated script Co-authored-by: alberto.petrucci <[email protected]> Co-authored-by: Francesco M <[email protected]>
1 parent 0f75a95 commit a5ac2f5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

decompressed/gui_file/usr/share/transformer/scripts/appInstallRemoveUtility.sh

+4-3
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,10 @@ app_transmission() {
6767
# Create script to trigger transmission restart when an usb is plugged in/out
6868
{
6969
echo '#!/bin/sh'
70-
echo 'if [ -d "/tmp/run/mountd/$DEVICENAME/sharing/config/transmission" ]; then'
71-
echo '/etc/init.d/transmission restart'
72-
echo 'fi'
70+
echo 'last_usb=$(ls -t /dev/sd* | tail -n 1)'
71+
echo 'last_usb=${last_usb#"/dev/"}'
72+
echo 'usb_count=$(find /tmp/run/mountd/ -mindepth 1 -maxdepth 1 -type d | wc -l)'
73+
echo '[ "$usb_count" == "0" ] && /etc/init.d/transmission stop || [ -d "/tmp/run/mountd/$last_usb/sharing/config/transmission" ] && /etc/init.d/transmission restart'
7374
} >/etc/hotplug.d/usb/60-transmission
7475

7576
cp -r /usr/share/transmission /www/docroot/

0 commit comments

Comments
 (0)