Created
May 11, 2020 19:20
-
-
Save x22element/eb1a4bf7f4d6e123663d3f4797f96b7f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo -e " | |
#!/bin/sh | |
init_error() { | |
local ret=1 | |
[ -z "$1" ] || printf "%s\n" "$1" | |
[ -z "$2" ] || ret=$2 | |
exit $ret | |
} | |
#Перезапуск веб-морды | |
PVEPXYRESTART='systemctl restart pveproxy.service' | |
#Что патчим | |
TGTPATH='/usr/share/perl5/PVE/API2' | |
TGTFILE='Subscription.pm' | |
#Проверяем, что sed есть в системе | |
SEDBIN="$(which sed)" | |
[ -x "$SEDBIN" ] || init_error "Где 'sed', Билли? Нам нужен 'sed'." | |
sed -i 's/NotFound/Active/g' "$TGTPATH/$TGTFILE" && $PVEPXYRESTART | |
r=$? | |
if [ $r -eq 0 ]; then | |
exit 0 | |
fi | |
echo -e "\033[35;41m\033[1mПроизошла ошибка"'!'" Скорее всего, она вызвана мажорным обновлением pve-manager или proxmox-widget-toolkit.\033[00m" | |
exit 1" >> /opt/pve-patch.sh | |
echo -e "DPkg::Post-Invoke {"/opt/pve-patch.sh";};" >> /etc/apt/apt.conf.d/99pvepatch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment