#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/../ssh/../python/../python/../python/../python/../python/../../usr/bin/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //../etc/python/../ssh/../python/../python/../python/../python/../python/../../usr/bin/jscal-store
#!/bin/sh

# Stores the current calibration settings for the given joystick
# (materialized by its device). The calibration settings are stored
# using the joystick's name and serial number if available, and its
# vendor and product codes if it's a USB device. If none of these can
# be determined, the settings are stored against the device name.

if [ -z "$1" ]; then
    echo "Usage: $0 {device}"
    echo "Stores the device's calibration for future use."
    exit 1
fi

if [ ! -x /sbin/udevadm ]; then
    echo Storing joystick configuration requires udev! >&2
    exit 1
fi

ident=$(mktemp)
/sbin/udevadm info -a -n $1 | /usr/libexec/joystick/ident > $ident
. $ident
rm $ident

STORE=/var/lib/joystick/joystick.state

if [ ! -d $(dirname $STORE) ]; then
    mkdir -p $(dirname $STORE)
    if [ $? -gt 0 ]; then
        echo Unable to create directory $(dirname $STORE)! >&2
        exit 1
    fi
fi

# Filter the existing file
if [ -f $STORE ]; then
    if [ -z "$NAME" ] && [ -z "$VENDOR" ]; then
	echo "No product name or vendor available, calibration will be stored for the"
	echo "given device name ($DEVICE) only!"
	/usr/libexec/joystick/filter kernel="$DEVICE" < $STORE > $STORE.new
    else
	/usr/libexec/joystick/filter name="$NAME" serial="$SERIAL" vendor="$VENDOR" product="$PRODUCT" < $STORE > $STORE.new
    fi
fi

# Append the new calibration information
if [ -f $STORE.new ] && [ ! -z "$(cat $STORE.new)" ]; then
    echo >> $STORE.new
fi
if [ -z "$NAME" ] && [ -z "$VENDOR" ]; then
    echo "DEVICE=\"$DEVICE\"" >> $STORE.new
fi
if [ ! -z "$NAME" ]; then
    echo "NAME=\"$NAME\"" >> $STORE.new
fi
if [ ! -z "$SERIAL" ]; then
    echo "SERIAL=\"$SERIAL\"" >> $STORE.new
fi
if [ ! -z "$VENDOR" ]; then
    echo "VENDOR=\"$VENDOR\"" >> $STORE.new
fi
if [ ! -z "$PRODUCT" ]; then
    echo "PRODUCT=\"$PRODUCT\"" >> $STORE.new
fi
# First store the axes mapping, then the calibration
# as they must be restored in the same order
jscal -q $1 | cut -d' ' -f-3 >> $STORE.new
jscal -p $1 | cut -d' ' -f-3 >> $STORE.new

if [ -f $STORE ]; then
    mv $STORE $STORE.old
fi
mv $STORE.new $STORE
rm -f $STORE.old