Skip to content

Commit

Permalink
Merge pull request #1310 from rern/UPDATE
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
rern authored May 23, 2023
2 parents fd64385 + 9721550 commit ab8aabf
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion srv/http/assets/js/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ $( '#backup' ).on( 'click', function() {
a.href = url;
a.download = 'backup.gz';
document.body.appendChild( a );
a.trigger( 'click' );
a.click();
setTimeout( () => {
a.remove();
window.URL.revokeObjectURL( url );
Expand Down
3 changes: 1 addition & 2 deletions srv/http/bash/cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,7 @@ lyrics )
. $dirsystem/lyrics.conf
if [[ $embedded && $( < $dirshm/player ) == mpd ]]; then
file=$( getVar file $dirshm/status )
dir=${file/\/*}
if [[ $dir == SD || $dir == USB ]]; then
if [[ ${file/\/*} =~ ^(USB|NAS|SD)$ ]]; then
file="/mnt/MPD/$file"
lyrics=$( kid3-cli -c "select \"$file\"" -c "get lyrics" )
[[ $lyrics ]] && echo "$lyrics" && exit
Expand Down
13 changes: 0 additions & 13 deletions srv/http/bash/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,6 @@ confNotString() {
confFromJson() { # $1 - file
sed -E '/\{|}/d; s/,//; s/^\s*"(.*)": "*(.*)"*$/\1="\2"/' "$1"
}
cpuInfo() {
local BB C hwrevision
hwrevision=$( grep ^Revision /proc/cpuinfo )
BB=${hwrevision: -3:2}
C=${hwrevision: -4:1}
data=BB=$BB$'\n'
data+=C=$C$'\n'
[[ $BB =~ ^(09|0c|12)$ ]] || data+=onboardsound=true$'\n' # not zero, zero w, zero 2w
[[ $BB =~ ^(00|01|02|03|04|09)$ ]] || data+=onboardwireless=true$'\n' # not zero, 1, 2
[[ $BB =~ ^(09|0c)$ ]] && data+=rpi0=true$'\n' # zero
[[ $BB == 0d ]] && data+=rpi3bplus=true$'\n' # 3B+
echo "$data" > $dirshm/cpuinfo
}
data2json() {
local data json
data="$1"
Expand Down
1 change: 0 additions & 1 deletion srv/http/bash/settings/system-data.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

. /srv/http/bash/common.sh
[[ -e $dirshm/cpuinfo ]] && . $dirshm/cpuinfo || cpuInfo

timezone=$( timedatectl | awk '/zone:/ {print $3}' )
timezoneoffset=$( date +%z | sed -E 's/(..)$/:\1/' )
Expand Down
12 changes: 11 additions & 1 deletion srv/http/bash/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@

. /srv/http/bash/common.sh

cpuInfo
hwrevision=$( grep ^Revision /proc/cpuinfo )
BB=${hwrevision: -3:2}
C=${hwrevision: -4:1}
data=BB=$BB$'\n'
data+=C=$C$'\n'
[[ $BB =~ ^(09|0c|12)$ ]] || data+=onboardsound=true$'\n' # not zero, zero w, zero 2w
[[ $BB =~ ^(00|01|02|03|04|09)$ ]] || data+=onboardwireless=true$'\n' # not zero, 1, 2
[[ $BB =~ ^(09|0c)$ ]] && data+=rpi0=true$'\n' # zero
[[ $BB == 0d ]] && data+=rpi3bplus=true$'\n' # 3B+
echo "$data" > $dirshm/cpuinfo

# wifi - on-board or usb
wlandev=$( $dirsettings/networks.sh wlandevice )

Expand Down
4 changes: 3 additions & 1 deletion srv/http/bash/status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

. /srv/http/bash/common.sh

mpc | grep ^Updating && updating_db=true || rm -f $dirmpd/updating
if [[ -e $dirmpd/updating ]]; then
mpc | grep -q ^Updating && updating_db=true || rm -f $dirmpd/updating
fi

if [[ -L $dirmpd && ! -e $dirmpd/counts ]]; then # shared data
for i in {1..10}; do
Expand Down
2 changes: 2 additions & 0 deletions srv/http/cmd.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
$option = '<option value="none">None / Auto detect</option>';
foreach( $list as $name => $sysname ) $option .= '<option value="'.$sysname.'">'.$name.'</option>';
echo $option;
break;
case 'selecttimezone':
$list = timezone_identifiers_list();
$option = '<option value="auto">Auto</option>';
Expand All @@ -97,6 +98,7 @@
$option .= '<option value="'.$zone.'">'.$zonename.'&ensp;'.$offset.'</option>';
}
echo $option;
break;

}

Expand Down

0 comments on commit ab8aabf

Please sign in to comment.