File: postrm

package info (click to toggle)
fvwm2 2.0.46-BETA-3
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 5,172 kB
  • ctags: 5,559
  • sloc: ansic: 52,902; cpp: 2,465; perl: 2,275; python: 779; sh: 604; makefile: 221
file content (33 lines) | stat: -rw-r--r-- 846 bytes parent folder | download | duplicates (2)
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
#!/bin/bash
set -e

FVWMDIR="/etc/X11/fvwm2"
CONFIGDONE="$FVWMDIR/config.done"
MENUPROG="/etc/menu-methods/fvwm2"
WINMGRS="/etc/X11/window-managers"

HOOKS="init-restart.hook init.hook main-menu-pre.hook main-menu.hook menudefs.hook post.hook pre.hook restart.hook"

# Purging means nuking config files
if [ "x$1" = "xpurge" ]; then
  rm -f $CONFIGDONE
  for i in $HOOKS; do
    if [ ! -L "$FVWMDIR/$i" ]; then
      rm -f "$FVWMDIR/$i"
    fi
    if [ ! -L "$FVWMDIR/$i.preinst.save" ]; then
      rm -f "$FVWMDIR/$i.preinst.save"
    fi
  done
  if [ -d "$FVWMDIR/.fvwm2" -a ! -L "$FVWMDIR/.fvwm2" ]; then
    rm -rf "$FVWMDIR/.fvwm2"
  fi
  rmdir $FVWMDIR || true  # don't care if this fails
  grep -v "/usr/X11R6/bin/fvwm2" $WINMGRS >$WINMGRS.$$
  mv -f $WINMGRS.$$ $WINMGRS

elif [ "x$1" = "xremove" ]; then
  chmod a-x $MENUPROG
fi

exit 0