Loader:CWiid Daemon Alternative

From Wah!ki
Revision as of 10:58, 18 January 2011 by Sairuk (talk | contribs) (Created page with "#!/bin/bash $Wiimote_Keymap = ir_wahcade # wiimote-mac is the name of the file with the mac address if [ -f wiimote-mac ]; then # if file exists MAC_ADDRESS=$(cat wiimote-...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
  1. !/bin/bash

$Wiimote_Keymap = ir_wahcade

  1. wiimote-mac is the name of the file with the mac address

if [ -f wiimote-mac ]; then # if file exists

   MAC_ADDRESS=$(cat wiimote-mac) # load mac address into the variable
   if [ ! -z "$MAC_ADDRESS" ]; then # if variable not empty
       echo "We already have a mac address configured: $MAC_ADDRESS"
       # run commands here
  wminput -d -c $Wiimote_Keymap $MAC_ADDRESS
       exit
   fi

fi

  1. We only fall here if the mac address is not configured...
  2. Configure the mac address, assign it to $MAC_ADDRESS and then store it inside
  3. the file

wminput -c $Wiimote_Keymap MAC_ADDRESS=$REPLY echo $MAC_ADDRESS > wiimote-mac