From 1d82e0ed034419da531503add7ca55abd6ce73f1 Mon Sep 17 00:00:00 2001 From: Mickael-Martin Date: Mon, 8 Jul 2019 13:34:09 +0200 Subject: [PATCH] ynh_replace_string --- scripts/upgrade | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 0536151..16e94b2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -98,7 +98,8 @@ nonfreepackagelist=$(dpkg-query -W -f='${Section}\t${Package}\n' | grep ^non-fre if [ $(echo $nonfreepackagelist | wc -l) -eq 1 ] && [ $(echo $nonfreepackagelist | grep -c "snmp-mibs-downloader") -eq 1 ] ;then ynh_print_info "Removing snmp-mibs-downloader (non-free package)" #want backup file , cannot use ynh_replace_string - sed --in-place==.$(date "+%m%d%y") 's/ snmp-mibs-downloader,//g' /var/lib/dpkg/status + cp /var/lib/dpkg/status{,.$(date "+%m%d%y")} + ynh_replace_string --match_string=" snmp-mibs-downloader," --replace_string="" --target_file=/var/lib/dpkg/status DEBIAN_FRONTEND=noninteractive apt purge snmp-mibs-downloader -y if [ -f /etc/apt/sources.list.d/non-free.list ];then ynh_secure_remove /etc/apt/sources.list.d/non-free.list