Skip to content

Commit

Permalink
add list.sh script
Browse files Browse the repository at this point in the history
displays all settings of all users or one setting for all users
  • Loading branch information
FreekBes committed May 5, 2022
1 parent 332f514 commit ccfcff5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions server/settings/list.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

# Display all settings when no arguments supplied, otherwise display only the filename + that setting
if [[ $# -eq 0 ]]; then
for f in *.json; do (cat "${f}"; echo); done
else
for f in *.json; do
VALUE=$(cat "${f}" | sed -n -e "s/^.*\"${1}\"://p" | cut -f1 -d",")
echo "${f}: $VALUE"
done
fi

0 comments on commit ccfcff5

Please sign in to comment.