# Make a backup before changing the configuration file
pre_install() {
    if [ -f /etc/nanorc ]; then
        mv -f /etc/nanorc /etc/nanorc.bkp
    fi
}

# Replace the original file with the new configuration file
post_install() {
    if [ -f /etc/nanorc.new ]; then
        mv -f /etc/nanorc.new /etc/nanorc
    fi
}

# Restore the original file
post_remove() {
    if [ -f /etc/nanorc.bkp ]; then
        mv -f /etc/nanorc.bkp /etc/nanorc
    fi
}
