using check for cronjob & enhanced reboot message
This commit is contained in:
@ -122,10 +122,14 @@ Utils.prototype.copyConfigs = function (isWpaEabled) {
|
|||||||
|
|
||||||
execSync('mv /usr/lib/raspiwifi/reset_device/static_files/raspiwifi.conf /etc/raspiwifi');
|
execSync('mv /usr/lib/raspiwifi/reset_device/static_files/raspiwifi.conf /etc/raspiwifi');
|
||||||
|
|
||||||
|
const command = '@reboot root run-parts /etc/cron.raspiwifi/'
|
||||||
|
if (!this.hasConfiguredCronJob(command)) {
|
||||||
/* TODO: Setting up CRON for running monitoring jobs */
|
/* TODO: Setting up CRON for running monitoring jobs */
|
||||||
this.printColor(null, 'Setting up CRON for running monitoring jobs');
|
this.printColor(null, 'Setting up CRON for running monitoring jobs');
|
||||||
execSync('echo "# RaspiWiFi Startup" >> /etc/crontab');
|
execSync('echo "# RaspiWiFi Startup" >> /etc/crontab');
|
||||||
execSync('echo "@reboot root run-parts /etc/cron.raspiwifi/" >> /etc/crontab');
|
execSync('echo "'+ command+'" >> /etc/crontab');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Finishing things up */
|
/* Finishing things up */
|
||||||
this.printColor(null, 'Finishing things up');
|
this.printColor(null, 'Finishing things up');
|
||||||
|
|||||||
@ -131,7 +131,9 @@ const consoleReset = lib.consoleColorCodes.Reset;
|
|||||||
let shouldReboot = false;
|
let shouldReboot = false;
|
||||||
do {
|
do {
|
||||||
inp = readline.question(
|
inp = readline.question(
|
||||||
`${lib.consoleColorCodes.FgRed}Would you like to do that now? [y/N]: ${consoleReset}`,
|
`${lib.consoleColorCodes.FgRed}
|
||||||
|
Initial setup is complete. A reboot is required to start in WiFi configuration mode...\n
|
||||||
|
Would you like to do that now? [y/N]: ${consoleReset}`,
|
||||||
{
|
{
|
||||||
defaultInput: 'n'
|
defaultInput: 'n'
|
||||||
})
|
})
|
||||||
@ -141,6 +143,6 @@ const consoleReset = lib.consoleColorCodes.Reset;
|
|||||||
if (shouldReboot)
|
if (shouldReboot)
|
||||||
lib.reboot();
|
lib.reboot();
|
||||||
|
|
||||||
lib.hasConfiguredCronJob('@reboot root run-parts /etc/cron.raspiwifi/')
|
|
||||||
}());
|
}());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user