Skip to content

Commit

Permalink
freetz functions: add cockpit_pruner
Browse files Browse the repository at this point in the history
  • Loading branch information
fda77 committed Oct 23, 2024
1 parent f96656a commit 4444831
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tools/freetz_functions
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@ supervisor_delete_service() {
}


# removes a div by id name in all cock pits (since fos8)
cockpit_pruner() {
local theid="$1"
for oem in $(supported_brandings) all; do
[ -d "${FILESYSTEM_MOD_DIR}/usr/www/${oem}" -a ! -L "${FILESYSTEM_MOD_DIR}/usr/www/${oem}" ] || continue
for file in ${FILESYSTEM_MOD_DIR}/usr/www/${oem}/js3/views/overview/cockpit.html ${FILESYSTEM_MOD_DIR}/usr/www/${oem}/js3/views/overview/cockpit.*.html; do
[ ! -e ${file} ] && continue
modsed -r \
"s/(=\"${theid}\"[^>]*)>/\1 style=\"display: none;\">/" \
"$file"
done
done
}


#linkbox_remove <menu-name>
#removes links within a box on the left
linkbox_remove() {
Expand Down

0 comments on commit 4444831

Please sign in to comment.