You are not logged in.

#1 2015-09-09 21:01:16

Oblivion7
Member
From: Outside your universe.
Registered: 2015-08-29
Posts: 78

Is it ok to handle .pacnew files with a script, I feel like its not.

Ok so i was wondering if i could use a script to handle .pacnew files I feel like thats a no but im unsure also if automation is a horrible choice whats the next best method and program to use.
script:

for PACNEW_FILE in `find /etc/ -name "*.pacnew"`; do
    BASE_FILE=`echo $PACNEW_FILE | sed '/\.pacnew//'`;
    meld $PACNEW_FILE $BASE_FILE;
    echo -n "Remove the file $PACNEW_FILE ? [y|n] ";
    read -n 1 CHOICE
    if [ "$CHOICE" = "y" ]; then
        rm $PACNEW_FILE;
    fi
done;

Last edited by Oblivion7 (2015-09-09 21:01:58)


Anyone who has never made a mistake has never tried anything new. ~Albert Einstein

Offline

#2 2015-09-09 21:05:55

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,902
Website

Re: Is it ok to handle .pacnew files with a script, I feel like its not.

Sure, this is what pacdiff does.

Not a SysAdmin issue moving to NC.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#3 2015-09-09 21:07:55

creatid
Member
From: Netherlands
Registered: 2009-12-19
Posts: 75
Website

Re: Is it ok to handle .pacnew files with a script, I feel like its not.

Why not use pacmatic? Looks like that will do what you intend with your script.

Offline

#4 2015-09-09 21:23:38

Oblivion7
Member
From: Outside your universe.
Registered: 2015-08-29
Posts: 78

Re: Is it ok to handle .pacnew files with a script, I feel like its not.

When I execute pacdiff this is the output.

Cannot find the vim -d binary required for viewing differences.

EDIT: WELP I didnt have vim installed *Facepalms*....  (im a dumb-dumb tongue)

Last edited by Oblivion7 (2015-09-09 21:27:03)


Anyone who has never made a mistake has never tried anything new. ~Albert Einstein

Offline

#5 2015-09-09 21:33:21

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,902
Website

Re: Is it ok to handle .pacnew files with a script, I feel like its not.

Check 'pacdiff -h', you can override the diff program and use meld if you prefer.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

Board footer

Powered by FluxBB