File tree Expand file tree Collapse file tree
on-boot-script-2.x/examples/udm-files/on_boot.d
on-boot-script/examples/udm-files/on_boot.d Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /bin/bash
2- # Get DataDir location
2+ # Get ${DATA_DIR} location
33DATA_DIR=" /data"
44case " $( ubnt-device-info firmware || true) " in
551* )
@@ -13,10 +13,18 @@ case "$(ubnt-device-info firmware || true)" in
1313 exit 1
1414 ;;
1515esac
16+
1617# # Store crontab files in ${DATA_DIR}/cronjobs/ (you will need to create this folder).
1718# # This script will re-add them on startup.
1819
1920cp ${DATA_DIR} /cronjobs/* /etc/cron.d/
20- /etc/init.d/crond restart
21+ # Older UDM's had crond, so lets check if its here if so use that one, otherwise use cron
22+ if [ -x /etc/init.d/crond ]; then
23+ /etc/init.d/crond restart
24+ elif [ -x /etc/init.d/cron ]; then
25+ /etc/init.d/cron restart
26+ else
27+ echo " Neither crond nor cron found."
28+ fi
2129
2230exit 0
Original file line number Diff line number Diff line change 11#! /bin/bash
2- # Get DataDir location
2+ # Get ${DATA_DIR} location
33DATA_DIR=" /data"
44case " $( ubnt-device-info firmware || true) " in
551* )
66 DATA_DIR=" /mnt/data"
77 ;;
8- 2* )
8+ 2* | 3 * | 4 * | 5 * )
99 DATA_DIR=" /data"
1010 ;;
11- 3* )
12- DATA_DIR=" /data"
13- ;;
14- 4* )
15- DATA_DIR=" /data"
16- ;;
1711* )
1812 echo " ERROR: No persistent storage found." 1>&2
1913 exit 1
2014 ;;
2115esac
16+
2217# # Store crontab files in ${DATA_DIR}/cronjobs/ (you will need to create this folder).
2318# # This script will re-add them on startup.
2419
2520cp ${DATA_DIR} /cronjobs/* /etc/cron.d/
2621# Older UDM's had crond, so lets check if its here if so use that one, otherwise use cron
2722if [ -x /etc/init.d/crond ]; then
28- /etc/init.d/crond restart
23+ /etc/init.d/crond restart
2924elif [ -x /etc/init.d/cron ]; then
30- /etc/init.d/cron restart
25+ /etc/init.d/cron restart
3126else
32- echo " Neither crond nor cron found."
27+ echo " Neither crond nor cron found."
3328fi
3429
3530exit 0
You can’t perform that action at this time.
0 commit comments