Added usher to run pwconv and grpconv if necessary

This commit is contained in:
2016-10-20 08:15:39 -05:00
parent 1ad126bacf
commit 653de8f1c6
2 changed files with 35 additions and 1 deletions

34
SNAP/usher Executable file
View File

@@ -0,0 +1,34 @@
#!/bin/bash
set -e
case $1 in
preinst)
exit 0
;;
postinst)
if [[ ${TARGET} ]]; then
if [ ! -f ${TARGET}/etc/shadow ]; then
chroot ${TARGET} pwconv
fi
if [ ! -f ${TARGET}/etc/gshadow ]; then
chroot ${TARGET} grpconv
fi
else
if [ ! -f /etc/shadow ]; then
pwconv
fi
if [ ! -f /etc/gshadow ]; then
grpconv
fi
fi
;;
prerm)
exit 0
;;
postrm)
exit 0
;;
esac