55set -e # exit on error
66. /usr/share/debconf/confmodule # Source debconf library.
77
8+
9+ # enable services, but don't start yet
10+ systemctl daemon-reload
11+ systemctl enable robotcontrol
12+ systemctl enable rc_battery_monitor
13+
14+ # in interactive mode, ask for configuration options
815if [ ! " $DEBIAN_FRONTEND " = " noninteractive" ] ; then
916
1017 # Fetching configuration from debconf
@@ -30,34 +37,30 @@ if [ ! "$DEBIAN_FRONTEND" = "noninteractive" ] ; then
3037 echo " setting nothing to run on boot"
3138 rm -f /etc/robotcontrol/link_to_startup_program
3239 else
33- echo " leaving current robotcontrol startup program alone"
40+ echo " leaving current robot control startup program alone"
3441 fi
3542
36- # enable services
37- echo " systemctl daemon-reload"
38- systemctl daemon-reload
39- echo " Enabling robotcontrol Service"
40- systemctl enable robotcontrol
41- echo " Enabling rc_battery_monitor Service"
42- systemctl enable rc_battery_monitor
43- # try to start battery monitor, but ignore errors as this may not work
44- echo " Starting rc_battery_monitor Service"
43+
44+ # try to start services, but ignore errors as this may not work
4545 set +e
4646 systemctl start rc_battery_monitor
47+ systemctl start robotcontrol
4748
4849 # leave error checking off when setting up device tree too
4950 if [ " $ENABLE_DT " = " true" ]; then
5051 echo " Configuring Device Tree"
5152 configure_robotics_dt
5253 fi
5354
54- echo " Robotics Cape package installation complete. "
55-
55+ echo " ********************************************** "
56+ echo " librobotcontrol package installation complete. "
5657 if [ " $ENABLE_DT " = " true" ]; then
57- echo " **********************************************"
5858 echo " Please reboot now to load new device tree."
59- echo " **********************************************"
6059 fi
60+ echo " **********************************************"
61+
62+ # put error checking back on in case debhelper wants it
63+ set -e
6164
6265fi
6366
0 commit comments