initial commit
This commit is contained in:
commit
0eec9e1064
29 changed files with 265 additions and 0 deletions
24
pacman-update-count
Executable file
24
pacman-update-count
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
_updates_available="-1"
|
||||
_target_file="/tmp/pacman-update-count"
|
||||
_user="ray"
|
||||
_user_id=$(id -u)
|
||||
|
||||
if ! [ "$_user_id" -eq 0 ] ; then
|
||||
echo "pacman-update-count.sh: insufficient priviliges: must be run as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
touch "$_target_file"
|
||||
chown root: "$_target_file"
|
||||
echo "$_updates_available" > "$_target_file"
|
||||
|
||||
pacman -Sy
|
||||
_updates_available=$(pacman -Qu | wc -l)
|
||||
|
||||
echo "Adding $_updates_available available updates to $_target_file"
|
||||
echo "$_updates_available" > "$_target_file"
|
||||
chown "$_user": "$_target_file"
|
||||
Loading…
Add table
Add a link
Reference in a new issue