modify self update mitigation
This commit is contained in:
parent
fe46b00ba6
commit
0c8c9bef98
2 changed files with 3 additions and 4 deletions
|
|
@ -139,4 +139,4 @@ deploy)
|
|||
*) usage && exit 1 ;;
|
||||
esac
|
||||
|
||||
[ -n "$_self_update" ] && gen_self_update && _ZPKG_SELF_UPGRADE=y exec "$_tmpzpkg" -R install zpkg
|
||||
[ -n "$_self_update" ] && do_self_update
|
||||
|
|
|
|||
|
|
@ -42,11 +42,10 @@ upgrade_package()
|
|||
## self upgrading mitigation
|
||||
|
||||
unset _self_update
|
||||
gen_self_update()
|
||||
do_self_update()
|
||||
{
|
||||
_tmpzpkg="$TMPDIR/zpkg_bin_$(random_string 5)"
|
||||
# copy current file
|
||||
cp "$0" "$_tmpzpkg" || return $?
|
||||
# make new script self-delete
|
||||
echo 'rm -f "$0"' >> "$_tmpzpkg"
|
||||
exec sh -c '_ZPKG_SELF_UPGRADE=y "$1" -R install zpkg ; rm -f "$1"' sh "$_tmpzpkg"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue