Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
trayopen [2013/07/13 21:57] – beandog | trayopen [2014/02/17 02:41] (current) – beandog | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== trayopen ====== | + | ====== trayopen |
+ | |||
+ | I wrote a similar program in C that does the same thing, but with more states. | ||
+ | |||
+ | ==== Archives | ||
This code has been a lifesaver to me when it comes to checking to see if a tray is open or not. Believe it or not, there' | This code has been a lifesaver to me when it comes to checking to see if a tray is open or not. Believe it or not, there' | ||
Line 50: | Line 54: | ||
#!/bin/bash | #!/bin/bash | ||
trayopen /dev/dvd | trayopen /dev/dvd | ||
- | if [[ $! -eq 0 ]]; then | + | if [[ $? -eq 0 ]]; then |
echo "Open for business!" | echo "Open for business!" | ||
- | elif [[ $! -eq 1 ]]; then | + | elif [[ $? -eq 1 ]]; then |
echo " | echo " | ||
fi | fi | ||
</ | </ |