REDROOM
PHP 8.5.2
Path:
Logout
Edit File
Size: 1.53 KB
Close
//lib/udev/usb_modeswitch
Text
Base64
#!/bin/sh # part of usb_modeswitch 2.6.1 device_in() { if [ ! -e /var/lib/usb_modeswitch/$1 ]; then return 0 fi while read line do if [ $(expr "$line" : "$2:$3") != 0 ]; then return 1 fi done </var/lib/usb_modeswitch/$1 if [ $(expr "$line" : "$2:$3") != 0 ]; then return 1 fi return 0 } if [ $(expr "$1" : "--.*") ]; then p_id=$4 if [ -z $p_id ]; then prod=$5 if [ -z $prod ]; then prod=$3 fi prod=${prod%/*} v_id=0x${prod%/*} p_id=0x${prod#*/} if [ "$v_id" = "0x" ]; then v_id="0" p_id="0" fi v_id="$(printf %04x $(($v_id)))" p_id="$(printf %04x $(($p_id)))" else v_id=$3 fi fi PATH=/sbin:/usr/sbin:$PATH case "$1" in --driver-bind) # driver binding code removed exit 0 ;; --symlink-name) device_in "link_list" $v_id $p_id if [ "$?" = "1" ]; then if [ -e "/usr/sbin/usb_modeswitch_dispatcher" ]; then export TMPDIR=/run exec usb_modeswitch_dispatcher $1 $2 2>>/dev/null fi fi exit 0 ;; esac IFS='/' read -r p1 p2 <<EOF $1 EOF if [ "$p2" = "" -a "$p1" != "" ]; then p2=$p1 fi PATH=/bin:/sbin:/usr/bin:/usr/sbin init_path=`readlink -f /sbin/init` if [ `basename $init_path` = "systemd" ] && [ -d "/run/systemd/system/" ]; then # Test if systemd is running systemctl --no-block restart usb_modeswitch@$p2.service elif [ -e "/etc/init/usb-modeswitch-upstart.conf" ]; then initctl emit --no-wait usb-modeswitch-upstart UMS_PARAM=$p2 else # only old distros, new udev will kill all subprocesses exec 1<&- 2<&- 5<&- 7<&- exec usb_modeswitch_dispatcher --switch-mode $p2 & fi exit 0
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 2 × Files: 16
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
hwdb.d
DIR
-
drwxr-xr-x
2026-01-08 12:55:11
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
rules.d
DIR
-
drwxr-xr-x
2026-02-07 06:05:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ata_id
82.72 KB
lrwxr-xr-x
2025-11-25 18:16:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
bcache-export-cached
1.13 KB
lrwxr-xr-x
2024-04-08 15:54:26
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
bcache-register
14.30 KB
lrwxr-xr-x
2024-04-08 15:54:26
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
cdrom_id
90.72 KB
lrwxr-xr-x
2025-11-25 18:16:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
dmi_memory_id
86.72 KB
lrwxr-xr-x
2025-11-25 18:16:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
fido_id
138.73 KB
lrwxr-xr-x
2025-11-25 18:16:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
hdparm
1.37 KB
lrwxr-xr-x
2022-10-06 12:47:47
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
hwdb.bin
11.72 MB
lr--r--r--
2026-01-08 12:55:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
iocost
150.85 KB
lrwxr-xr-x
2025-11-25 18:16:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
kpartx_id
2.33 KB
lrwxr-xr-x
2025-07-22 15:44:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
mtd_probe
34.57 KB
lrwxr-xr-x
2025-11-25 18:16:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
probe-bcache
14.30 KB
lrwxr-xr-x
2024-04-08 15:54:26
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
scsi_id
87.23 KB
lrwxr-xr-x
2025-11-25 18:16:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
snappy-app-dev
18.23 KB
lrwxr-xr-x
2025-11-21 07:08:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
usb_modeswitch
1.53 KB
lrwxr-xr-x
2024-04-08 16:21:24
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
v4l_id
34.57 KB
lrwxr-xr-x
2025-11-25 18:16:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).