View Single Post
Posts: 1,522 | Thanked: 392 times | Joined on Jul 2010 @ São Paulo, Brazil
#21
Here is the script i came up with after reading cmantito's post and this shell scripting tutorial filled with typos and other writing mistakes :


Code:
# The nice msgs i'm writing without testing,
# the original code has a bunch of random phrases here and there

# run the script without parameters to see a list of the accounts 
# present, name an account (without the ID part) and it should 
# toggle the status of that account

# I make no promises this is safe and i hold no resposibility for any 
# damage it might cause

if [ $# == 0 ]
then
echo "Which one?"
gconftool-2 --all-dirs /apps/modest/accounts
echo "Use the stuff between 'accounts/' and 'ID' "
else

status=`gconftool-2 -g /apps/modest/accounts/$1ID/enabled `

if [ $status == "false" ]
then
echo "Enabling $1 now"
echo `gconftool-2 -s /apps/modest/accounts/$1ID/enabled --type bool true`
elif [ $status == "true" ]
then
echo "Disabling $1 now"
echo `gconftool-2 -s /apps/modest/accounts/$1ID/enabled --type bool false`
else
echo "Oops!"
fi
echo "Done, i think"
fi

Last edited by TiagoTiago; 2010-12-28 at 07:11.
 

The Following 2 Users Say Thank You to TiagoTiago For This Useful Post: