#PEAR_Config 0.9 a:12:{s:7:"php_dir";s:67:"//pear/php";s:8:"data_dir";s:68:"//pear/data";s:7:"www_dir";s:67:"//pear/www";s:7:"cfg_dir";s:67:"//pear/cfg";s:7:"ext_dir";s:67:"//pear/ext";s:7:"doc_dir";s:68:"//pear/docs";s:8:"test_dir";s:69:"//pear/tests";s:9:"cache_dir";s:69:"//pear/cache";s:12:"download_dir";s:72:"//pear/download";s:8:"temp_dir";s:68:"//pear/temp";s:7:"bin_dir";s:63:"//pear";s:7:"man_dir";s:67:"//pear/man";}
|
Server IP : 99.192.176.69 / Your IP : 216.73.217.68 Web Server : Apache System : Linux platinumpuzzy2.eosdns.net 3.10.0-1160.71.1.el7.x86_64 #1 SMP Tue Jun 28 15:37:28 UTC 2022 x86_64 User : bbwcamhouse ( 1000) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0555) : /../etc/python/../rpm/../python/../python/../python/../python/../python/../../../bin/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
#!/bin/bash
if [ -z "$1" ]; then
echo "Usage: $0 {device}"
echo "Restores the device's calibration."
exit 1
fi
if [ ! -x /sbin/udevadm ]; then
echo Restoring joystick configuration requires udev! >&2
exit 1
fi
STORE=/var/lib/joystick/joystick.state
if [ ! -f $STORE ]; then
echo No saved joystick configuration\(s\) to restore! >&2
exit 1
fi
DEVICE=""
NAME=""
SERIAL=""
VENDOR=""
PRODUCT=""
# Backup original $IFS (Internal Field Separator) variable
OIFS=$IFS
# Set $IFS to newline only as output from /usr/libexec/joystick/ident might contain spaces
# in the NAME value
IFS=$'\x0A'
for ATTRIBUTE in $( /sbin/udevadm info -a -n $1 | /usr/libexec/joystick/ident ); do
ID=$( echo "$ATTRIBUTE" | cut -f 1 -d = )
VALUE=$( echo "$ATTRIBUTE" | cut -f 2 -d \" )
case $ID in
"DEVICE" ) DEVICE="$VALUE" ;;
"NAME" ) NAME="$VALUE" ;;
"SERIAL" ) SERIAL="$VALUE" ;;
"VENDOR" ) VENDOR="$VALUE" ;;
"PRODUCT" ) PRODUCT="$VALUE" ;;
esac
done
# Restore original $IFS
IFS=$OIFS
# Retrieve the applicable commands
if [ -z "$NAME" ] && [ -z "$VENDOR" ]; then
# Use the device name only
cat $STORE | /usr/libexec/joystick/extract kernel="$DEVICE" | while read COMMAND; do
$COMMAND $1
done
else
cat $STORE | /usr/libexec/joystick/extract name="$NAME" serial="$SERIAL" vendor="$VENDOR" product="$PRODUCT" | while read COMMAND; do
$COMMAND $1
done
fi