userspace:updatethunderbird
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
| — | userspace:updatethunderbird [2022/02/14 15:12] (current) – created Thomas_H | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ===== updateThunderbird ===== | ||
| + | By // | ||
| + | < | ||
| + | #!/bin/bash | ||
| + | # | ||
| + | ############################################################################## | ||
| + | # first we declare some variables. A good programmer is a lazy programmer :) | ||
| + | ############################################################################## | ||
| + | opsiproduct_path="/ | ||
| + | product=" | ||
| + | setupname=" | ||
| + | geturl=" | ||
| + | urladd="/ | ||
| + | # Attention! following grepvar-string is a regular expression!! Leave the [^"]* at the end!! | ||
| + | grepvar=https:// | ||
| + | searchstr=' | ||
| + | alt_ver=$(date +" | ||
| + | startpos=51 | ||
| + | ############################################################################## | ||
| + | # | ||
| + | # ATTENTION! FOR TESTING FIRST ALL REAL COMMANDS ARE COMMENTED OUT BY # --- !! WHEN CHANGING TO PRODUCTION YOU'LL HAVE TO REMOVE THE # --- THEN! | ||
| + | # | ||
| + | # first, let's remove the last valid exe-file | ||
| + | rm $opsiproduct_path/ | ||
| + | |||
| + | # get the new setup-file from website and rename it to a standard file name (so no need to change the setup.ins :P ) | ||
| + | |||
| + | if [ " | ||
| + | setupprg=$setupname | ||
| + | else | ||
| + | # here we try to find the full name of the new setup-file. For example we know start and ending of the file, but not the rest. | ||
| + | # Example: Setup-file-name is always " | ||
| + | # " | ||
| + | # | ||
| + | echo URL=$geturl$urladd | ||
| + | setupprg=$( wget --no-check-certificate $geturl$urladd -q -O- | grep -om1 $grepvar) | ||
| + | fi | ||
| + | |||
| + | echo setupprg=$setupprg | ||
| + | wget --no-check-certificate " | ||
| + | |||
| + | # Do we need to unzip the file first? If so, watch the right name of setup.exe is written in setup.ins | ||
| + | # --- unzip -o $opsiproduct_path/ | ||
| + | # --- rm $opsiproduct_path/ | ||
| + | |||
| + | # let's change the directory to the package | ||
| + | cd $opsiproduct_path/ | ||
| + | # remove the *.opsi-files | ||
| + | rm *.opsi | ||
| + | rm *.zsync | ||
| + | rm *.md5 | ||
| + | |||
| + | # to find out, which version it is, we do a little bit of awk | ||
| + | if [ $startpos != 0 ]; then | ||
| + | pos=$(echo $setupprg | grep -b -o $searchstr | awk 'BEGIN {FS=":" | ||
| + | # well done, we found it. | ||
| + | version=$(echo $setupprg | cut -c$startpos-$pos) | ||
| + | else | ||
| + | version=$alt_ver | ||
| + | fi | ||
| + | echo Version=$version | ||
| + | # now let's change the / | ||
| + | sed " | ||
| + | mv $opsiproduct_path/ | ||
| + | |||
| + | # make new package, but quiet | ||
| + | opsi-makepackage -q | ||
| + | opsi-package-manager -i *.opsi | ||
| + | </ | ||
userspace/updatethunderbird.txt · Last modified: by Thomas_H
