Skip to content

Commit 42b672c

Browse files
committed
complete script directory cleanup
1 parent 786cba2 commit 42b672c

File tree

4 files changed

+69
-66
lines changed

4 files changed

+69
-66
lines changed

scripts/NOTES.txt

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,32 @@
77
copy_settings_to_storage.sh: /opt/fpp/www/copystorage.php
88
detect_cape: /opt/fpp/www/api/controllers/cape.php
99
eventScript: /opt/fpp/www/runEventScript.php
10+
format_storage: /opt/fpp/www/formatstorage.php
1011
fpp_build: /opt/fpp/www/rebuildfpp.php
1112
fppd_restart: /opt/fpp/www/manualUpdate.php
1213
fppd_start: git_branch, git_checkout_version, fppd_restart
1314
fppd_stop: git_branch, git_checkout_version, fppd_restart
14-
format_storage: /opt/fpp/www/formatstorage.php
15+
get_uuid: /opt/fpp/www/common.php, function getSystemUUID(), api/controllers/stats.php
16+
git_branch: /opt/fpp/www/changebranch.php
17+
git_checkout_version: /opt/fpp/www/gitCheckoutVersion.php
18+
git_fetch: /opt/fpp/www/api/controllers/git.php
19+
git_origin_log: /opt/fpp/www/api/controllers/git.php
20+
git_pull: /opt/fpp/www/manualUpdate.php
21+
git_reset: /opt/fpp/www/api/controllers/git.php
22+
get_status: /opt/fpp/www/api/controllers/git.php
1523
handle_boot_actions: FPPINIT.cpp
1624
healthCheck: /opt/fpp/www/healthCheckHelper.php
25+
install_plugin: /opt/fpp/www/api/controllers/plugin.php
1726
installScript: /opt/fpp/www/api/controllers/scripts.php
27+
installSSHKeys /opt/fpp/www/api/controllers/configfile.php
28+
ManageApacheContentPolicy.sh: /opt/fpp/www/CSP_regeneration_script.php
1829
restoreScript: /opt/fpp/www/backup.php
1930
wifi_scan.sh: /opt/fpp/www/troubleshoot-commands.json
20-
upgrade_FPP: /opt/fpp/www/upgradefpp.php
21-
upgrade_config: git_branch, git_pull, upgrade_FPP, /opt/fpp/www/about.php
31+
uninstall_plugin: /opt/fpp/www/api/controllers/plugin.php
2232
upgradeCapeFirmware: /opt/fpp/www/upgradeCapeFirmware.php
33+
upgrade_config: git_branch, git_pull, upgrade_FPP, /opt/fpp/www/about.php
34+
upgrade_FPP: /opt/fpp/www/upgradefpp.php
35+
wifiscan: /opt/fpp/www/troubleshoot-commands.json
2336

2437
# Should keep
2538
generateEEPROM
26-
27-
# Needs investigation
28-
get_uuid: /opt/fpp/www/common.php

scripts/handle_boot_actions

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/usr/bin/php
2+
<?php
3+
$skipJSsettings = true;
4+
require_once('/opt/fpp/www/config.php');
5+
require_once('/opt/fpp/www/common.php');
6+
require_once('/opt/fpp/www/common/settings.php');
7+
function HandleSettings() {
8+
global $settings;
9+
if (array_key_exists("TimeZone", $settings)) ApplySetting("TimeZone", $settings["TimeZone"]);
10+
if (array_key_exists("ntpServer", $settings)) ApplySetting("ntpServer", $settings["ntpServer"]);
11+
if (array_key_exists("ForceHDMI", $settings)) ApplySetting("ForceHDMI", $settings["ForceHDMI"]);
12+
if (array_key_exists("ForceHDMIResolution", $settings)) ApplySetting("ForceHDMIResolution", $settings["ForceHDMIResolution"]);
13+
if (array_key_exists("ForceHDMIResolutionPort2", $settings)) ApplySetting("ForceHDMIResolutionPort2", $settings["ForceHDMIResolutionPort2"]);
14+
if (array_key_exists("wifiDrivers", $settings)) ApplySetting("wifiDrivers", $settings["wifiDrivers"]);
15+
if (array_key_exists("GPIOFan", $settings)) ApplySetting("GPIOFan", $settings["GPIOFan"]);
16+
if (array_key_exists("Kiosk", $settings)) ApplySetting("Kiosk", $settings["Kiosk"]);
17+
if (array_key_exists("EnableBBBHDMI", $settings)) ApplySetting("EnableBBBHDMI", $settings["EnableBBBHDMI"]);
18+
if (array_key_exists("Service_rsync", $settings)) ApplyServiceSetting("Service_rsync", $settings["Service_rsync"], "--now");
19+
if (array_key_exists("Service_smbd_nmbd", $settings)) ApplyServiceSetting("Service_smbd_nmbd", $settings["Service_smbd_nmbd"], "--now");
20+
if (array_key_exists("Service_vsftpd", $settings)) ApplyServiceSetting("Service_vsftpd", $settings["Service_vsftpd"], "--now");
21+
}
22+
function HandleExpandFS() {
23+
global $settings;
24+
if ($settings['Platform'] == "BeagleBone Black") {
25+
$command = "sudo /opt/fpp/SD/BBB-grow_partition.sh 2>&1";
26+
} else if ($settings['Platform'] == "Raspberry Pi") {
27+
$command = "sudo /usr/bin/raspi-config --expand-rootfs";
28+
}
29+
system($command);
30+
system("/sbin/reboot -f");
31+
exit(0);
32+
}
33+
$actions = explode(",", $settings["BootActions"]);
34+
$action = array_shift($actions);
35+
while ($action != NULL) {
36+
echo "Performing boot action: " . $action . "\n";
37+
38+
// save the actions we haven't handled yet back out to settings in case
39+
// we reboot or something we can keep processing
40+
$newactions = implode(",", $actions);
41+
if ($newactions == "") {
42+
DeleteSettingFromFile("BootActions");
43+
} else {
44+
WriteSettingToFile("BootActions", $newactions);
45+
}
46+
47+
if ($action == "settings") {
48+
HandleSettings();
49+
} else if ($action == "expandfs") {
50+
HandleExpandFS();
51+
}
52+
$action = array_shift($actions);
53+
}

scripts/runFunction

Lines changed: 0 additions & 20 deletions
This file was deleted.

scripts/update_plugin

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)