Server : Apache/2.4.18 (Ubuntu) System : Linux canvaswebdesign 3.13.0-71-generic #114-Ubuntu SMP Tue Dec 1 02:34:22 UTC 2015 x86_64 User : oppastar ( 1041) PHP Version : 7.0.33-0ubuntu0.16.04.15 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, Directory : /usr/sbin/ |
Upload File : |
#!/bin/sh # see also update-pciids.sh (fancier) [ "$1" = "-q" ] && quiet="true" || quiet="false" set -e SRC="http://www.linux-usb.org/usb.ids" DEST=/var/lib/usbutils/usb.ids # if usb.ids is read-only (because the filesystem is read-only), # then just skip this whole process. if ! touch ${DEST} >&2 >/dev/null ; then ${quiet} || echo "${DEST} is read-only, exiting." exit 0 fi if which wget >/dev/null 2>&1 ; then DL="wget -O $DEST.new $SRC" ${quiet} && DL="$DL -q" elif which lynx >/dev/null 2>&1 ; then DL="eval lynx -source $SRC >$DEST.new" else echo >&2 "update-usbids: cannot find wget nor lynx" exit 1 fi if ! $DL ; then echo >&2 "update-usbids: download failed" rm -f $DEST.new exit 1 fi if ! grep >/dev/null "^C " $DEST.new ; then echo >&2 "update-usbids: missing class info, probably truncated file" exit 1 fi if [ -f $DEST ] ; then mv $DEST $DEST.old # --reference is supported only by chmod from GNU file, so let's ignore any errors chmod -f --reference=$DEST.old $DEST.new 2>/dev/null || true fi mv $DEST.new $DEST ${quiet} || echo "Done."