Tiny Core Extensions > TCE Tips & Tricks
Quick Firefox Updater Script
maluvia:
Wrote a simple script to create a new firefox extension after firefox has updated itself.
(This is how I have been updating my firefox for the past year.)
This can be kept in ~/.local/bin, and run every time firefox updates itself.
Don't know if this will be useful to anyone, but am attaching the script.
This is my first ever script, so any feedback is appreciated :-)
coreplayer2:
good job, but now we have three such scripts, two are already extension's in the repo
http://forum.tinycorelinux.net/index.php/topic,17879.msg108266.html#msg108266
Misalf:
Having multiple options is mostly always a plus though. (:
Also this one will pack any modifications made to firefox into the created extension.
One suggestion.
Make sure squashfs-tools (or squashfs-tools-4.x.tcz on TC 5.x) are available.
--- Code: ---tce-load -w squashfs-tools.tcz
tce-load -i squashfs-tools.tcz
--- End code ---
maluvia:
Updated the script to check for squashfs-tools, and attached updated script.
I just like this one because it is simple, and really fast.
Thanks for the feedback :-)
Misalf:
You could replace this
--- Code: ---if [ -f "/usr/local/tce.installed/squashfs-tools" ]
then
echo "${GREEN}Installed${NORMAL}"
elif [ -f "/etc/sysconfig/tcedir/optional/squashfs-tools.tcz" ]
then echo "${GREEN}Loading squashfs-tools:${NORMAL}" && tce-load -i squashfs-tools.tcz
else echo "${GREEN}Installing squashfs-tools:${NORMAL}" && tce-load -wi squashfs-tools.tcz
fi
--- End code ---
with just this
--- Code: ---tce-load -w squashfs-tools
tce-load -i squashfs-tools
--- End code ---
It would just say that "squashfs-tools.tcz is already downloaded." if present. Otherwise download it.
The next command will only load it if not already loaded.
tce-load -wi ... will add an entry to the onboot.lst for the tcz which might not be wanted.
tce-load -wil ... will not load the extension if already downloaded.
So a combination of two commands (with -w and -i parameter respectively) is more reliable for different situations and less code.
Or to make it more error aware
--- Code: ---tce-load -w squashfs-tools
tce-load -i squashfs-tools
if [ ! -e /usr/local/tce.installed/squashfs-tools* ]; then
echo "Failed to download/install squashfs-tools. Exiting"
sleep 5
exit 1
fi
--- End code ---
Navigation
[0] Message Index
[#] Next page
Go to full version