You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
690 B
30 lines
690 B
---
|
|
title: "Update Check"
|
|
date: 2010-04-28T21:51:46+01:00
|
|
draft: false
|
|
tags: ["arch-linux"]
|
|
---
|
|
|
|
Da es ja Menschen geben soll, die nicht so regelmäßig nach Updates für ihr Betriebsystem suchen, habe ich mir dieses kleine Shell-Script geschrieben, welches ich mit Cron aufrufe:
|
|
|
|
```bash
|
|
#!/bin/bash
|
|
|
|
pacman -Sy
|
|
DATA=`pacman -Qu | wc -l`
|
|
FILE=/opt/check_updates.data
|
|
|
|
if [ $DATA -eq 1 ] ; then
|
|
echo -e -n "Es ist ein Update verfuegbar! " > $FILE
|
|
elif [ $DATA -gt 1 ] ; then
|
|
echo -e -n "Es sind $DATA Updates verfuegbar! " > $FILE
|
|
else
|
|
echo -e -n "Es ist kein Update verfuegbar" > $FILE
|
|
fi
|
|
|
|
if [ $DATA -gt 0 ] ; then
|
|
pacman -Qu >> $FILE
|
|
exec xmessage -file $FILE
|
|
fi
|
|
```
|