rewrite scripts
try to provide better syntax and avoid using bash
This commit is contained in:
24
debian/templates/image.prerm.in
vendored
24
debian/templates/image.prerm.in
vendored
@@ -1,17 +1,21 @@
|
||||
#!/bin/sh -e
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
version=@abiname@@localversion@
|
||||
image_path=/boot/@image-stem@-$version
|
||||
[ "$1" = remove ] || exit 0
|
||||
|
||||
if [ "$1" != remove ]; then
|
||||
exit 0
|
||||
version='@abiname@@localversion@'
|
||||
image_path="/boot/@image-stem@-${version}"
|
||||
|
||||
if command -v linux-check-removal >/dev/null ; then
|
||||
linux-check-removal "${version}"
|
||||
fi
|
||||
|
||||
linux-check-removal $version
|
||||
|
||||
if [ -d /etc/kernel/prerm.d ]; then
|
||||
DEB_MAINT_PARAMS="$*" run-parts --report --exit-on-error --arg=$version \
|
||||
--arg=$image_path /etc/kernel/prerm.d
|
||||
if [ -d /etc/kernel/prerm.d ] ; then
|
||||
DEB_MAINT_PARAMS="$*" \
|
||||
run-parts --report --exit-on-error \
|
||||
"--arg=${version}" \
|
||||
"--arg=${image_path}" \
|
||||
/etc/kernel/prerm.d
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
Reference in New Issue
Block a user