lo_install-deb.sh
· 1.5 KiB · Bash
Bruto
#!/bin/bash
# A script to install or update libreoffice releases properly
if [[ "$1" == "-x" ]]; then
shift
set -x
fi
me=`basename $0`
Usage() {
echo "Usage: $me [-x][-h|--help] <gzipped-tarball> [<gzipped-tarball>...]"
exit 0
}
if [[ -z "$1" || "$1" == "-h" || "$1" == "--help" ]]; then Usage; fi
# Change these to install on rpm base systems
tgt=DEBS
cmd="dpkg -i"
sfx=deb
for tb in $*; do
if [[ ! -f $tb ]]; then
if [[ -f "$tb.tgz" ]]; then
tb="$tb.tgz"
elif [[ -f "$tb.tar.gz" ]]; then
tb="$tb.tar.gz"
else
echo "Can't find $tb or $tb.tgz or $tb.tar.gz - skipping..."
read ln
continue
fi
fi
# find out what the name of the uncompressed subdirectory will be
dst=`tar tzf $tb 2> /dev/null | head -1 | awk -F/ '{print $1}'`
tar xzf $tb
if [[ ! -d $dst/$tgt ]]; then
echo "Can't find $me directory $dst/$tgt - skipping..."
read ln
continue
fi
# install or update, depending on how I was called
cd $dst/$tgt
case $me in
loinst)
sudo $cmd *.$sfx
if [[ -d desktop-integration ]]; then
cd desktop-integration
sudo $cmd *.$sfx
cd ..
fi
cd ../..
;;
loupdate)
cd ..
sudo ./update
cd ..
;;
esac
# delete the installation directory
/bin/rm -rf $dst
done
echo ""
| 1 | #!/bin/bash |
| 2 | |
| 3 | # A script to install or update libreoffice releases properly |
| 4 | |
| 5 | if [[ "$1" == "-x" ]]; then |
| 6 | shift |
| 7 | set -x |
| 8 | fi |
| 9 | |
| 10 | me=`basename $0` |
| 11 | Usage() { |
| 12 | echo "Usage: $me [-x][-h|--help] <gzipped-tarball> [<gzipped-tarball>...]" |
| 13 | exit 0 |
| 14 | } |
| 15 | |
| 16 | if [[ -z "$1" || "$1" == "-h" || "$1" == "--help" ]]; then Usage; fi |
| 17 | |
| 18 | # Change these to install on rpm base systems |
| 19 | tgt=DEBS |
| 20 | cmd="dpkg -i" |
| 21 | sfx=deb |
| 22 | |
| 23 | for tb in $*; do |
| 24 | if [[ ! -f $tb ]]; then |
| 25 | if [[ -f "$tb.tgz" ]]; then |
| 26 | tb="$tb.tgz" |
| 27 | elif [[ -f "$tb.tar.gz" ]]; then |
| 28 | tb="$tb.tar.gz" |
| 29 | else |
| 30 | echo "Can't find $tb or $tb.tgz or $tb.tar.gz - skipping..." |
| 31 | read ln |
| 32 | continue |
| 33 | fi |
| 34 | fi |
| 35 | |
| 36 | # find out what the name of the uncompressed subdirectory will be |
| 37 | dst=`tar tzf $tb 2> /dev/null | head -1 | awk -F/ '{print $1}'` |
| 38 | tar xzf $tb |
| 39 | if [[ ! -d $dst/$tgt ]]; then |
| 40 | echo "Can't find $me directory $dst/$tgt - skipping..." |
| 41 | read ln |
| 42 | continue |
| 43 | fi |
| 44 | |
| 45 | # install or update, depending on how I was called |
| 46 | cd $dst/$tgt |
| 47 | case $me in |
| 48 | loinst) |
| 49 | sudo $cmd *.$sfx |
| 50 | if [[ -d desktop-integration ]]; then |
| 51 | cd desktop-integration |
| 52 | sudo $cmd *.$sfx |
| 53 | cd .. |
| 54 | fi |
| 55 | cd ../.. |
| 56 | ;; |
| 57 | loupdate) |
| 58 | cd .. |
| 59 | sudo ./update |
| 60 | cd .. |
| 61 | ;; |
| 62 | esac |
| 63 | |
| 64 | # delete the installation directory |
| 65 | /bin/rm -rf $dst |
| 66 | done |
| 67 | |
| 68 | echo "" |
lo_install-rpm.sh
· 1.5 KiB · Bash
Bruto
#!/bin/bash
# A script to install or update libreoffice releases properly
if [[ "$1" == "-x" ]]; then
shift
set -x
fi
me=`basename $0`
Usage() {
echo "Usage: $me [-x][-h|--help] <gzipped-tarball> [<gzipped-tarball>...]"
exit 0
}
if [[ -z "$1" || "$1" == "-h" || "$1" == "--help" ]]; then Usage; fi
# Change these to install on rpm base systems
tgt=RPMS
cmd="rpm -i"
sfx=rpm
for tb in $*; do
if [[ ! -f $tb ]]; then
if [[ -f "$tb.tgz" ]]; then
tb="$tb.tgz"
elif [[ -f "$tb.tar.gz" ]]; then
tb="$tb.tar.gz"
else
echo "Can't find $tb or $tb.tgz or $tb.tar.gz - skipping..."
read ln
continue
fi
fi
# find out what the name of the uncompressed subdirectory will be
dst=`tar tzf $tb 2> /dev/null | head -1 | awk -F/ '{print $1}'`
tar xzf $tb
if [[ ! -d $dst/$tgt ]]; then
echo "Can't find $me directory $dst/$tgt - skipping..."
read ln
continue
fi
# install or update, depending on how I was called
cd $dst/$tgt
case $me in
loinst)
sudo $cmd *.$sfx
if [[ -d desktop-integration ]]; then
cd desktop-integration
sudo $cmd *.$sfx
cd ..
fi
cd ../..
;;
loupdate)
cd ..
sudo ./update
cd ..
;;
esac
# delete the installation directory
/bin/rm -rf $dst
done
echo ""
| 1 | #!/bin/bash |
| 2 | |
| 3 | # A script to install or update libreoffice releases properly |
| 4 | |
| 5 | if [[ "$1" == "-x" ]]; then |
| 6 | shift |
| 7 | set -x |
| 8 | fi |
| 9 | |
| 10 | me=`basename $0` |
| 11 | Usage() { |
| 12 | echo "Usage: $me [-x][-h|--help] <gzipped-tarball> [<gzipped-tarball>...]" |
| 13 | exit 0 |
| 14 | } |
| 15 | |
| 16 | if [[ -z "$1" || "$1" == "-h" || "$1" == "--help" ]]; then Usage; fi |
| 17 | |
| 18 | # Change these to install on rpm base systems |
| 19 | tgt=RPMS |
| 20 | cmd="rpm -i" |
| 21 | sfx=rpm |
| 22 | |
| 23 | for tb in $*; do |
| 24 | if [[ ! -f $tb ]]; then |
| 25 | if [[ -f "$tb.tgz" ]]; then |
| 26 | tb="$tb.tgz" |
| 27 | elif [[ -f "$tb.tar.gz" ]]; then |
| 28 | tb="$tb.tar.gz" |
| 29 | else |
| 30 | echo "Can't find $tb or $tb.tgz or $tb.tar.gz - skipping..." |
| 31 | read ln |
| 32 | continue |
| 33 | fi |
| 34 | fi |
| 35 | |
| 36 | # find out what the name of the uncompressed subdirectory will be |
| 37 | dst=`tar tzf $tb 2> /dev/null | head -1 | awk -F/ '{print $1}'` |
| 38 | tar xzf $tb |
| 39 | if [[ ! -d $dst/$tgt ]]; then |
| 40 | echo "Can't find $me directory $dst/$tgt - skipping..." |
| 41 | read ln |
| 42 | continue |
| 43 | fi |
| 44 | |
| 45 | # install or update, depending on how I was called |
| 46 | cd $dst/$tgt |
| 47 | case $me in |
| 48 | loinst) |
| 49 | sudo $cmd *.$sfx |
| 50 | if [[ -d desktop-integration ]]; then |
| 51 | cd desktop-integration |
| 52 | sudo $cmd *.$sfx |
| 53 | cd .. |
| 54 | fi |
| 55 | cd ../.. |
| 56 | ;; |
| 57 | loupdate) |
| 58 | cd .. |
| 59 | sudo ./update |
| 60 | cd .. |
| 61 | ;; |
| 62 | esac |
| 63 | |
| 64 | # delete the installation directory |
| 65 | /bin/rm -rf $dst |
| 66 | done |
| 67 | |
| 68 | echo "" |