Push out Firefox bookmarks to multiple users


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Push out Firefox bookmarks to multiple users
# 1  
Old 09-17-2008
Push out Firefox bookmarks to multiple users

Ok, so I want to push out Firefox bookmarks to all the student accounts on my Mac server, but we all know how fun-loving Firefox profiles are, with their random czg6hi72.default profile names.

My question is how would I send the bookmarks.html file out to /Students/<username>/Library/Application Support/Firefox/Profiles/czg6hi72.default when the czg6hi72.default is going to be different for every account. Since that is the only folder in the Profiles folder, is there a way to say go into whichever folder is in the Profiles folder?

Please let me know if this doesn't make any sense.. even I'm getting confused!!
Thanks!
# 2  
Old 09-18-2008
Hmmm, tricky one.... I went into my ~/.mozilla/firefox and did "ls -la" :
Quote:
drwx------ 7 sysgate users 4096 2008-09-18 17:53 cbx50a5a.default
-rw-r--r-- 1 sysgate users 94 2008-07-23 15:41 profiles.ini
- the bookmarks.html is in cbx50a5a.default folder, as well as some other files.
So, it looks like you cannot predict the numbers that are before the .default, and you can't do "cd *.default", obviously, so my workaround suggestion would be to get the file you want to be distributed, and post it on HTTP server, somewhere, where everyone can access it, mail all the students, saying : please download this file, and update your bookmarks accordingly".
I would love, however, to see programmatic way to solve this.
# 3  
Old 09-18-2008
or you can go the easy way and install an extension to do so.

or you can force them to use your own home page, wich has the links

depends on how much "power" over those usres and pc you have
and how much they awnt the bookmarks
# 4  
Old 09-18-2008
It's not much problem to write a small shell script to do this. You allready know where to put the file, part from the random default userid string. I'm assuming that you have full privileges over the home directories so you could do something like:

Code:
find /Students/*/Library/Application Support/Firefox/Profiles/ -name "bookmarks.html" > /tmp/firefox_bookmark_loc.out
cat /tmp/firefox_bookmark_loc.out | while read line
do
mv /my/new/bookmars.html $line
done

Something like this should do the trick - but ofcourse it overwrites what is previously set in the bookmarks, but according to your post I assume thats allrigt?
# 5  
Old 09-19-2008
Why not export your bookmarks and ask them to import?

Actually, I am surprised that you say the bookmark location is a random directory. Whereever I have talked to people about this topic, it is :
~/Library/Application Support/Firefox/Profiles/8j7l8qg8.default/bookmarks.html

If you google that code, you will find many entries. Of course, I am most likely wrong.
# 6  
Old 09-19-2008
Quote:
Originally Posted by yodomino6
Ok, so I want to push out Firefox bookmarks to all the student accounts on my Mac server, but we all know how fun-loving Firefox profiles are, with their random czg6hi72.default profile names.

My question is how would I send the bookmarks.html file out to /Students/<username>/Library/Application Support/Firefox/Profiles/czg6hi72.default when the czg6hi72.default is going to be different for every account. Since that is the only folder in the Profiles folder, is there a way to say go into whichever folder is in the Profiles folder?

Please let me know if this doesn't make any sense.. even I'm getting confused!!
Thanks!
profile.ini holds the path

Code:
#! /bin/ksh
#
# /Students/<username>/Library/Application Support/Firefox/Profiles/czg6hi72.default

# path to bookmarks.html
#
bookmark=bkmk.html

for student in $(<list_of_students.txt)
do
  cd "/Students/${student}/Library/Application Support/FireFox"

  # Check for the default path in profile.ini
  # This should handle the IsRelative param as well
  #
  path=$(grep -Ei "^path" profile.ini)
  cd ${path}

  #backup the previous bookmarks
  #
  /bin/mv bookmarks.html bookmarks.html.$(date +%Y%m%d)
 
  # Deploy the new one
  #
  /bin/cp ${bookmark} .
done

Adapt this to suit your needs.

Last edited by vino; 09-19-2008 at 02:08 AM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

5 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Create multiple users with individual passwords to users

hi, i am new to shell scripts i write a shell script to create multiple users but i need to give passwords to that users while creating users, command to write this script (1 Reply)
Discussion started by: DONFOX
1 Replies

2. UNIX and Linux Applications

Firefox Warning message for closing with multiple tabs not working

Can anyone explain why firefox warning message for closing with multiple tabs not working. The checkbox for warning when you have multiple tabs is checked so I don't understand why its not working. (0 Replies)
Discussion started by: cokedude
0 Replies

3. UNIX and Linux Applications

install multiple versions of firefox in linux

Since apt-get and yum won't let you install multiple versions of firefox I will explain how to here. 1. Go to this page and decide which version of firefox you want. ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/ I used this one. ... (0 Replies)
Discussion started by: cokedude
0 Replies

4. UNIX for Advanced & Expert Users

How to install firefox extensions for all users

Hello, I am wondering the "new way" to install firefox extensions for all users. From https://developer.mozilla.org/En/Command_Line_Options we can see that the "old way" is no longer available. I'm using the Lucid UNE to write this and note that it has these extensions installed for every... (3 Replies)
Discussion started by: Narnie
3 Replies

5. Solaris

multiple displays of characters with one push of the key.

Hi, I have a Ultra5 440MHz system running Solaris 2.6 (Rev 5.6) and have a problem with the keyboard. When I push a key it prints characters very quickly. If I push a key very fast I get maybe 3 characters. So, I am thinking bad keyboard. I borrow a known good keyboard, samething and the... (3 Replies)
Discussion started by: mndavies
3 Replies
Login or Register to Ask a Question