Ian: This is what I'm changing the Debian setup script to:
Code:
--------------------
#!/bin/sh
# Debian, Ubuntu, etc. setup script for the SrvrPowerCtrl plugin
#
echo 'Setting up SrvrPowerCtrl plugin for Debian-Ubuntu..'
user=`whoami`
if [ "$user" != "root" ]
then
echo 'Error: This script needs to be run with root cridentials,'
echo "either via # sudo $0"
echo 'or under su.'
exit
fi
#change to the script's directory..
SRC_SCRIPT_DIR=`dirname $0`
cd "$SRC_SCRIPT_DIR"
#fixup permissions for our plugin
chown -R squeezecenter:nogroup ../../.
#target script directory..
TRG_SCRIPT_DIR="/usr/bin"
#copy the scripts into the scriptdir..
cp "$SRC_SCRIPT_DIR/scwakeup.sh" $TRG_SCRIPT_DIR
cp "$SRC_SCRIPT_DIR/screstart.sh" $TRG_SCRIPT_DIR
#fix permissions on the scripts..
chmod a+x "$TRG_SCRIPT_DIR/scwakeup.sh"
chown root:root "$TRG_SCRIPT_DIR/scwakeup.sh"
chmod a+x "$TRG_SCRIPT_DIR/screstart.sh"
chown root:root "$TRG_SCRIPT_DIR/screstart.sh"
#Allow the squeezecenter user to use the 'shutdown' command..
touch /etc/shutdown.allow
echo 'squeezecenter' >>/etc/shutdown.allow
#Tell sudo that the squeezecenter user has permissions to run these commands..
echo 'squeezecenter ALL = NOPASSWD: /sbin/shutdown*' >>/etc/sudoers
echo 'squeezecenter ALL = NOPASSWD: /usr/sbin/pm-suspend' >>/etc/sudoers
echo 'squeezecenter ALL = NOPASSWD: /usr/sbin/pm-hibernate' >>/etc/sudoers
echo "squeezecenter ALL = NOPASSWD: $TRG_SCRIPT_DIR/scwakeup.sh"
>>/etc/sudoers
echo "squeezecenter ALL = NOPASSWD: $TRG_SCRIPT_DIR/screstart.sh"
>>/etc/sudoers
echo 'Done!'
--------------------
The crucial missing bit that I've added is the instructions for the
script to change directory to its own dir.
Again, sorry to have caused you so much grief! And thank you again for
pointing out my error...which is surely deserving of inclusion in the
annals of the "Big Book of Small Mistakes".
--
gharris999
------------------------------------------------------------------------
gharris999's Profile: http://forums.slimdevices.com/member.php?userid=115
View this thread: http://forums.slimdevices.com/showthread.php?t=48521
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins