Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CHANGE CONFIGURATION] #26

Open
gonzalomoreno05 opened this issue Dec 7, 2022 · 0 comments
Open

[CHANGE CONFIGURATION] #26

gonzalomoreno05 opened this issue Dec 7, 2022 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@gonzalomoreno05
Copy link

Which platform does your requested change effect?
Linux/UbuntuLTS

**Is your feature request related to a problem? **
In the "Configure automatic updates" section of the Ubuntu-LTS-post-install.sh script, it appears to be deleting some lines inside two files, and rewritting them with the apropriate value, however, this is only done if a previous grep command is not able to locate the text inside this files. I have done some tests and as this lines are contained previously in this files, the code never executes and the values stored in the files never change. I'm not sure if this is the spected behaviour for this code, but in my tests it usually affects on the autocleaninterval not being set up weekly.

Following is the code mentioned above.

Configure automatic updates.

echo -e "${HIGHLIGHT}Configuring automatic updates...${NC}"
EXISTS=$(grep "APT::Periodic::Update-Package-Lists" /etc/apt/apt.conf.d/20auto-upgrades)
if [ -z "$EXISTS" ]; then
sed -i '/APT::Periodic::Update-Package-Lists/d' /etc/apt/apt.conf.d/20auto-upgrades
echo "APT::Periodic::Update-Package-Lists "1";" >> /etc/apt/apt.conf.d/20auto-upgrades
fi

EXISTS=$(grep "APT::Periodic::Unattended-Upgrade" /etc/apt/apt.conf.d/20auto-upgrades)
if [ -z "$EXISTS" ]; then
sed -i '/APT::Periodic::Unattended-Upgrade/d' /etc/apt/apt.conf.d/20auto-upgrades
echo "APT::Periodic::Unattended-Upgrade "1";" >> /etc/apt/apt.conf.d/20auto-upgrades
fi

EXISTS=$(grep "APT::Periodic::AutocleanInterval" /etc/apt/apt.conf.d/10periodic)
if [ -z "$EXISTS" ]; then
sed -i '/APT::Periodic::AutocleanInterval/d' /etc/apt/apt.conf.d/10periodic
echo "APT::Periodic::AutocleanInterval "7";" >> /etc/apt/apt.conf.d/10periodic
fi

@gonzalomoreno05 gonzalomoreno05 added the documentation Improvements or additions to documentation label Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant