aboutsummaryrefslogtreecommitdiffstats
path: root/menu/update-menus
blob: 7baeb12a7e8c4b38a54901cd46f10d23965a18d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/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 
 echo 
fi