LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   A Script to Update Linux on boot (https://www.linuxquestions.org/questions/linux-newbie-8/a-script-to-update-linux-on-boot-4175413925/)

wakrein 06-28-2012 08:02 PM

A Script to Update Linux on boot
 
So i want to create a script that updates Kubuntu on boot.
So far i got:
Code:

#!/bin/bash
sudo -u root sudo apt-get update && sudo -u root apt-get upgrade

Hope this looks good, if it does my next question is... Do i drop this script in /etc/init.d/ ? If not where? Thanks for your help guys.

truboy 06-29-2012 03:08 AM

Hi,

From this site, it seems that you can just add your script to /etc/rc.local, without removing the exit 0 in the end.

wakrein 06-30-2012 12:54 AM

I got it! rc.local starts before kde is opperational. So i figured there must be some script i can use after KDE ititializes found it in /home/user/.kde/Autostart/. Put my auto update script there
Code:

!/bin/sh -e
sudo apt-get update && sudo apt-get -y upgrade && kdialog --msgbox "Linux Update Successful"
exit 0

-y for yes prompt i think.

I wish there was a way to inform me if it didnt work

kindofabuzz 06-30-2012 12:58 AM

Kubuntu doesn't have something that already checks for updates at starup? i'm sure it does.


All times are GMT -5. The time now is 05:46 AM.