diff options
author | Frederic Crozat <fcrozat@mandriva.com> | 2007-08-23 17:34:44 +0000 |
---|---|---|
committer | Frederic Crozat <fcrozat@mandriva.com> | 2007-08-23 17:34:44 +0000 |
commit | 16c61ccf6d1fdd4cd9c98dfd430d09f88d9c5cdf (patch) | |
tree | 050079df8c95b5b7fde44627f6af0e0701fea9f6 /trunk/menu/update-menus | |
parent | ccc8bdd743d36a098eb1abbd9ffcb5b30979e3a8 (diff) | |
download | common-data-16c61ccf6d1fdd4cd9c98dfd430d09f88d9c5cdf.tar common-data-16c61ccf6d1fdd4cd9c98dfd430d09f88d9c5cdf.tar.gz common-data-16c61ccf6d1fdd4cd9c98dfd430d09f88d9c5cdf.tar.bz2 common-data-16c61ccf6d1fdd4cd9c98dfd430d09f88d9c5cdf.tar.xz common-data-16c61ccf6d1fdd4cd9c98dfd430d09f88d9c5cdf.zip |
V2008_0_2mdv
Diffstat (limited to 'trunk/menu/update-menus')
-rwxr-xr-x | trunk/menu/update-menus | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/trunk/menu/update-menus b/trunk/menu/update-menus new file mode 100755 index 0000000..bd21520 --- /dev/null +++ b/trunk/menu/update-menus @@ -0,0 +1,48 @@ +#!/bin/sh + +usage() { +echo "Usage: update-menus [options]" +echo " -v Be verbose about what is going on." +echo " -u generate only user menu (useful for root user)" +echo " -h, --help This message." + +exit 0 +} + + +VERBOSE=0 + +if [ "$DURING_INSTALL" = "1" ]; then + exit 0 +fi + +if [ "$UID" == "0" ]; then + USER_MENU=0 +else + USER_MENU=1 +fi + +if [ $# != 0 ]; then + +while getopts ":vunh" option +do + case $option in + v ) VERBOSE=1 ; RUN_PARTS_ARG="--verbose" ;; + u ) USER_MENU=1 ;; + h ) usage ;; + esac +done +fi + +export VERBOSE +export USER_MENU + +if [ -d /etc/menu.d ]; then + run-parts $RUN_PARTS_ARG /etc/menu.d + if [ "$USER_MENU" = "1" ]; then + touch "$HOME/.menu-updates.stamp" 2> /dev/null + else + touch /var/lib/menu/.menu-updates.stamp 2> /dev/null + fi +fi + |