## arg 1:  the new package version
pre_install() {
	systemctl stop big-screen-monitor-display.service 2>/dev/null || true
}

## arg 1:  the new package version
post_install() {
	chmod +x /usr/bin/big-screen-monitor-display.sh
	chmod +x /usr/share/big-screen-monitor-display/main.py

	# Configura o serviço systemd
	systemctl daemon-reload
	systemctl enable --now big-screen-monitor-display.service
	systemctl start big-screen-monitor-display.service
}

## arg 2:  the old package version
post_upgrade() {
	post_install
}

## arg 1:  the old package version
pre_remove() {
	systemctl stop big-screen-monitor-display.service 2>/dev/null || true
	systemctl disable big-screen-monitor-display.service 2>/dev/null || true
}

## arg 1:  the old package version
post_remove() {
	systemctl daemon-reload
}
