Files
be.ems/tools/misc/insdeppkg.sh
2023-11-20 16:36:37 +08:00

21 lines
837 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
DepPkgDir=/tmp/omc-dep-pkg
lines=22 #这个值是指这个脚本的行数加1指向程序所在开始行
tail +$lines $0 >/tmp/omc-dep-pkg.tar.gz # 利用tail命令把脚本指定行出到文件$0表示脚本本身名称$0是环境变量这个命令用来把从$lines开始的内容写入一个/tmp目录的tar.gz文件里。
echo -n "Decompressing omc depend package ..."
echo "done"
tar xvfz /tmp/omc-dep-pkg.tar.gz -C /tmp 1>/dev/null
if [ ! -e ${DepPkgDir} ]; then
echo "${DepPkgDir}: Not such file or directory"
exit 1
fi
echo -n "Installing omc depend package ..."
for pkgdir in ${DepPkgDir}/*; do
#echo "Installing ${pkgdir} depend package ..."
cd ${pkgdir};
dpkg -i --ignore-depends *.deb 1>/tmp/${pkgdir}.log 2>&1;
done
echo "done"
rm -rf /tmp/omc-dep-pkg*
exit 0