slack-autoupdate

Update your Slackware system automatically
git clone git://git.server.ky/slackcoder/slack-autoupdate
Log | Files | Refs | README

README.md (3660B)


      1 # Slack Autoupdate
      2 
      3 Update your Slackware system automatically by integrating these simple
      4 customizable bash scripts.
      5 
      6 The updates are downloaded in the background for installation during the next
      7 startup.  If available, you are given the chance to opt out of the upgrade by
      8 pressing enter.  For server situations, the system can be configured to reboot
      9 after a specified time to upgrade automatically.  More advanced users could
     10 integrate email notifications giving admins time to intervene when necessary.
     11 
     12 Update information is stored under the /var/spool/slack-autoupdate directory.
     13 
     14 ## Support
     15 
     16 These scripts only currently support stable Slackware64 releases (sorry -current).
     17 
     18 Please refer to the project's [linux questions
     19 post](https://www.linuxquestions.org/questions/slackware-14/tool-to-help-with-automatic-updates-4175735340/)
     20 for feedback and bug reports. You can find known bugs or possible improvements
     21 on the project's
     22 [todo](https://git.server.ky/slackcoder/slack-autoupdate/tree?h=todo) branch.
     23 
     24 ## Installation and Configuration
     25 
     26 There are three components. the [cron script](./src/slack-autoupdate) which
     27 downloads packages, the [rc.slack-autoupdate script](./src/rc.slack-autoupdate)
     28 which installs the packages, and the [install-kernel
     29 script](./src/install-kernel) which updates your computer after a kernel
     30 update.
     31 
     32 ### Cron script
     33 
     34 Your system downloads the packages using this script.
     35 
     36 Adjust the script using your favorite editor:
     37 
     38 ```
     39 vim src/slack-autoupdate
     40 ```
     41 
     42 Then as root:
     43 
     44 ```
     45 cp src/slack-autoupdate /etc/cron.hourly
     46 chown root:root /etc/cron.hourly/slack-autoupdate
     47 chmod +x /etc/cron.hourly/slack-autoupdate
     48 ```
     49 
     50 ### rc.slack-autoupdate
     51 
     52 Your system updates your installed packages using this script.
     53 
     54 Adjust the script using your favorite editor:
     55 
     56 ```
     57 vim src/rc.slack-autoupdate
     58 ```
     59 
     60 Then as root:
     61 
     62 ```
     63 cp src/rc.slack-autoupdate /etc/rc.d/
     64 chown root:root /etc/rc.d/rc.slack-autoupdate
     65 ```
     66 
     67 Then add this to /etc/rc.d/rc.local:
     68 
     69 ```
     70 if [ -x /etc/rc.d/rc.slack-autoupdate ]; then
     71   /etc/rc.d/rc.slack-autoupdate
     72 fi
     73 ```
     74 
     75 To enable installation on reboot:
     76 
     77 ```
     78 chmod +x /etc/rc.d/rc.slack-autoupdate
     79 ```
     80 
     81 or to disable it again:
     82 
     83 ```
     84 chmod -x /etc/rc.d/rc.slack-autoupdate
     85 ```
     86 
     87 ### install-kernel
     88 
     89 This part depends on your system setup and will automatically update the kernel
     90 into your system.  You should modify it to suit your circumstance.
     91 
     92 The default script assumes you are using elilo and the kernel for your EFI is
     93 installed into /efi/EFI/Slackware/vmlinuz.
     94 
     95 Adjust the script to your system using your favorite editor:
     96 
     97 ```
     98 vim install-kernel
     99 ```
    100 
    101 Then as root:
    102 
    103 ```
    104 cp install-kernel /usr/local/sbin
    105 chown root:root /usr/local/sbin/install-kernel
    106 chmod +x /usr/local/sbin/install-kernel
    107 ```
    108 
    109 ## Source
    110 
    111 ### Customizing Update Downloads
    112 
    113 You can add a section to the [cron script](./src/slack-autoupdate) to pull
    114 updates using different tools or sources. The sections use the following
    115 structure.  Place the code within the 'if-then' block just after the 'exec'.
    116 Examples may be found in the [recipes](./src/recipes) directory.
    117 
    118 ```
    119 if ! OUTPUT="$(
    120   # Redirect error output to standard output.
    121   exec 2>&1
    122 
    123   # Your update code goes here.
    124   #
    125   # Download updates into $STAGING_DIR.
    126   #
    127   # On failure the command output is appended to the error file.
    128   # Update information should be appended to the $UPDATE_INFO file.
    129 
    130 )"; then
    131   if [ -f "$UPDATE_ERROR" ]; then
    132     >>"$UPDATE_ERROR" echo ""
    133     >>"$UPDATE_ERROR" echo ""
    134   fi
    135 
    136   >>"$UPDATE_ERROR" echo -e "[Update Name]:\n\n$OUTPUT"
    137 fi
    138 ```
    139 
    140 ### Testing
    141 
    142 You can test the project by running the shell files under the 'test' folder.
    143 
    144 ```
    145 sh src/test/*.sh
    146 ```