libmtp.sh.in

来自「Media transfer protocol implementation o」· IN 代码 · 共 46 行

IN
46
字号
#!/bin/sh# Lifts a plugged in MTP device to user space and# optionally runs a client program.# Written by Linus Walleij 2006, based on the "usbcam"# script by Nalin Dahyabhai.DEVICEOWNER=rootDEVICEPERMS=666# Special quirk for SuSE systems using "resmgr"# (see http://rechner.lst.de/~okir/resmgr/)if [ -f /sbin/resmgr ]then    /sbin/resmgr "${ACTION}" "${DEVICE}" desktop usb    exit 0fi# This is for most other distributionsif [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ]then    # New code, using lock files instead of copying /dev/console permissions    # This also works with non-gdm logins (e.g. on a virtual terminal)    # Idea and code from Nalin Dahyabhai <nalin@redhat.com>    if [ "x$DEVICEOWNER" = "xCONSOLE" ]    then	if [ -f /var/run/console/console.lock ]	then	    DEVICEOWNER=`cat /var/run/console/console.lock`	elif [ -f /var/run/console.lock ]	then	    DEVICEOWNER=`cat /var/run/console.lock`	elif [ -f /var/lock/console.lock ]	then	    DEVICEOWNER=`cat /var/lock/console.lock`	else	    DEVICEOWNER="nobody"	    DEVICEPERMS="666"	fi    fi    if [ -n "$DEVICEOWNER" ]    then        chmod 0000 "${DEVICE}"        chown "${DEVICEOWNER}" "${DEVICE}"        chmod "${DEVICEPERMS}" "${DEVICE}"    fifi

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?