all_off="$(tput sgr0)"
bold="${all_off}$(tput bold)"
blue="${bold}$(tput setaf 4)"
yellow="${bold}$(tput setaf 3)"

msg_blue() {
    printf "${blue}==>${bold} $1${all_off}\n"
}

note() {
    printf "${blue}==>${yellow} NOTE:${bold} $1${all_off}\n"
}

post_install() {
    note "Enable the Lenovo config service with:"
    echo "sudo systemctl enable --now lenovo-cfgservice.service"
    note "If your system has a Fibocom L860-GL-16/FM350 or a Quectel EM160R-GL/RM520N-GL"
    note "Consider adding options --test-low-power-suspend-resume and --test-quick-suspend-resume to ModemManager.service"
}

post_upgrade() {
    post_install
}

pre_remove() {
    msg_blue "Stopping lenovo-cfgservice.service"
    systemctl disable --now lenovo-cfgservice.service
}
