POSTIN
/bin/sh
if [ -x /usr/bin/update-menus ]; then /usr/bin/update-menus || true ; fi
# Fix the paths to the modules in the prefs files...
# Note that $ has to be escaped so the shell doesn't wack
# them.
perl <<EOP
while (my (@pwent) = getpwent()) {
my \$homedir = \$pwent[7];
my \$prefs;
if (open PREFS, "<\$homedir/.ayttm/prefs") {
while (<PREFS>) {
s!/usr/share/ayttm/modules!/usr/lib/ayttm!g;
\$prefs .= \$_;
}
close PREFS;
unless (rename("\$homedir/.ayttm/prefs","\$homedir/.ayttm/prefs.orig")) {
warn "Cannot \$homedir/.ayttm/prefs to \$homdir/.ayttm/prefs.orig";
next;
}
open PREFS, ">\$homedir/.ayttm/prefs";
print PREFS \$prefs;
close PREFS;
}
}
EOP
POSTUN
/bin/sh
if [ "$1" = "0" -a -x /usr/bin/update-menus ]; then /usr/bin/update-menus || true ; fi