You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
137 lines
3.2 KiB
137 lines
3.2 KiB
#!/bin/bash
|
|
|
|
compress_cam(){
|
|
cd "$bdir"
|
|
upx_c="-1"
|
|
|
|
[ -f "$configdir/upx_option" ] && source "$configdir/upx_option"
|
|
[ "$UPX" == "not_set" ] || upx_c=$UPX
|
|
|
|
erg=$(upx "$upx_c" "$1" |grep oscam |awk '{print $1" "$3" "$4 }')
|
|
e1="$(echo "$erg"| awk '{printf("%4.2fk\n", $1 /1024)}')"
|
|
e2="$(echo "$erg"| awk '{printf("%4.2fk\n", $2 /1024)}')"
|
|
e3="$(echo "$erg"| awk '{print $3}') (level=$upx_c)"
|
|
|
|
echo -e "\n
|
|
$w_l\r BEFORE -----> $txt_compress1\t= $g_n$e1
|
|
$w_l\r AFTER ------> $txt_compress2\t= $g_l$e2
|
|
$w_l\r RESULT -----> $txt_compress3\t= $c_n$e3
|
|
$rs_"
|
|
}
|
|
|
|
compress_cam_gui(){
|
|
cd "$bdir"
|
|
upx_c="-1"
|
|
|
|
[ -f "$configdir/upx_option" ] && source "$configdir/upx_option"
|
|
[ "$UPX" == "not_set" ] || upx_c=$UPX
|
|
|
|
erg=$(upx "$upx_c" "$1" |grep oscam |awk '{print $1" "$3" "$4 }')
|
|
e1="$(echo "$erg"| awk '{printf("%4.2f k\n", $1 /1024)}')"
|
|
e2="$(echo "$erg"| awk '{printf("%4.2fk\n", $2 /1024)}')"
|
|
e3="$(echo "$erg"| awk '{print $3}')\n"
|
|
|
|
echo -en "\n$txt_compress1\t= $e1\n$txt_compress2\t= $e2\n$txt_compress3\t= $e3"
|
|
}
|
|
|
|
tar_cam_gui(){
|
|
cd "$bdir"
|
|
erg=$(tar zcf $1.tar.gz $1 $2)
|
|
|
|
if [ -f "$1.tar.gz" ]
|
|
then
|
|
printf "\n$1.tar.gz\ncreated\n"
|
|
if [ -f "$adir/$1.tar.gz" ]
|
|
then
|
|
rm -rf "$adir/$1.tar.gz"
|
|
mv -f "$1.tar.gz" "$adir"
|
|
printf "\n$1.tar.gz\n$txt_to\n$workdir/archive\n"
|
|
else
|
|
mv -f "$1.tar.gz" "$adir"
|
|
printf "\n$1.tar.gz\n$txt_to\n$workdir/archive\n"
|
|
fi
|
|
else
|
|
printf "\nerror\nno $1.tar.gz\ncreated\n"
|
|
fi
|
|
}
|
|
|
|
tar_cam(){
|
|
cd "$bdir"
|
|
|
|
if [ -n $2 ]
|
|
then
|
|
printf "$y_n\n TAR -------->$w_l $1$g_l $txt_as$w_l $1.tar.gz$rs_"
|
|
fi
|
|
|
|
erg=$(tar zcf $1.tar.gz $1 $2)
|
|
|
|
if [ -f "$1.tar.gz" ]
|
|
then
|
|
printf "$p_n$txt_done$rs_\n"
|
|
|
|
if [ -f "$adir/$1.tar.gz" ]
|
|
then
|
|
rm -rf "$adir/$1.tar.gz"
|
|
mv -f "$1.tar.gz" "$adir"
|
|
printf "$c_l"" MOVE -------> $p_l$1.tar.gz $g_l$txt_to $y_n$workdir/archive$rs_\n\n"
|
|
else
|
|
mv -f "$1.tar.gz" "$adir"
|
|
printf "$c_l"" MOVE -------> $p_l$1.tar.gz $g_l$txt_to $y_n$workdir/archive$rs_\n\n"
|
|
fi
|
|
|
|
else
|
|
printf "$r_l\nerror\n no $1.tar.gz\n created$rs_\n"
|
|
fi
|
|
}
|
|
|
|
tarsvn(){
|
|
cd "$workdir"
|
|
|
|
if [ -f "$svndir/config.sh" ]
|
|
then
|
|
cp -f "$svndir/config.sh" "$configdir/config.sh.master"
|
|
[ -f "$svndir/Makefile" ] && cp -f "$svndir/Makefile" "$configdir/Makefile.master"
|
|
printf "$w_l SVN Backup :$c_l "
|
|
tar -zcf "$bsvn/$("$svndir/config.sh" -r).tar.gz" oscam-svn
|
|
fi
|
|
|
|
cd "$bsvn"
|
|
ln -sf "$bsvn/$("$svndir/config.sh" -r).tar.gz" "last.tar.gz"
|
|
printf "done$re_\n\n"
|
|
}
|
|
|
|
untarsvn(){
|
|
cd "$workdir"
|
|
|
|
[ -d oscam-svn ] && rm -rf oscam-svn;
|
|
|
|
if [ -z "$1" ]
|
|
then
|
|
[ -f "$bsvn/last.tar.gz" ] && tar -xf "$bsvn/last.tar.gz"
|
|
printf "\e[1A $w_l SVN Revision : $c_l$(basename $(readlink -f $bsvn/last.tar.gz) .tar.gz)$w_l\n"
|
|
else
|
|
|
|
if [ -f "$bsvn/$1.tar.gz" ]
|
|
then
|
|
tar -xf "$bsvn/$1.tar.gz"
|
|
cd $bsvn
|
|
ln -sf "$bsvn/$("$svndir/config.sh" -r).tar.gz" "last.tar.gz"
|
|
printf "\e[1A $w_l SVN Revision : $c_l$(basename $(readlink -f $bsvn/last.tar.gz) .tar.gz)$w_l\n"
|
|
else
|
|
|
|
if [ -f "$bsvn/last.tar.gz" ]
|
|
then
|
|
tar -xf "$bsvn/last.tar.gz"
|
|
printf "\e[1A $w_l SVN Revision : $c_l$(basename $(readlink -f $bsvn/last.tar.gz) .tar.gz)$w_l\n"
|
|
else
|
|
printf "$w_l SVN Backup :$r_l $txt_not_found\n"
|
|
sleep 3
|
|
checkout
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
[ -f "$workdir/SVN-IS-PATCHED" ] && rm -f "$workdir/SVN-IS-PATCHED"
|
|
}
|
|
|