36 lines
716 B
Bash
Executable File
36 lines
716 B
Bash
Executable File
#!/bin/sh
|
|
# prerm script for chillcraftos-splash
|
|
|
|
set -e
|
|
|
|
cleanup_cmdline() {
|
|
local cmdline="$1"
|
|
[ -e "$cmdline" ] || return
|
|
|
|
sed -i "$cmdline" \
|
|
-e 's/ quiet//' \
|
|
-e 's/ splash//' \
|
|
-e 's/ plymouth.ignore-serial-consoles//'
|
|
}
|
|
|
|
case "$1" in
|
|
remove|deconfigure)
|
|
if command -v plymouth-set-default-theme >/dev/null; then
|
|
PTHEME="$(plymouth-set-default-theme)"
|
|
if [ "$PTHEME" = "chillcraftos" ]; then
|
|
FW_LOC="$(/usr/lib/raspberrypi-sys-mods/get_fw_loc)"
|
|
CMDLINE="$FW_LOC/cmdline.txt"
|
|
cleanup_cmdline "$CMDLINE"
|
|
fi
|
|
fi
|
|
;;
|
|
upgrade|failed-upgrade)
|
|
;;
|
|
*)
|
|
echo "prerm called with unknown argument \`$1'" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
exit 0
|