mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-28 21:56:31 +00:00
Add 20190127.sh post-upgrade script
This commit is contained in:
parent
a4092b77e4
commit
c296914e4a
25
board/common/overlay/usr/share/post-upgrade/20190127.sh
Executable file
25
board/common/overlay/usr/share/post-upgrade/20190127.sh
Executable file
@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
# transform various variables in /data/etc/*.conf to uppercase
|
||||
|
||||
function to_uppercase() {
|
||||
IFS='='
|
||||
while read line; do
|
||||
parts=(${line})
|
||||
echo $(tr 'a-z' 'A-Z' <<< ${parts[0]})=${parts[1]}
|
||||
done
|
||||
unset IFS
|
||||
}
|
||||
|
||||
function process_file() {
|
||||
# $1 - file path
|
||||
test -f $1 || return
|
||||
|
||||
cat $1 | to_uppercase > $1
|
||||
}
|
||||
|
||||
process_file /data/etc/os.conf
|
||||
process_file /data/etc/watch.conf
|
||||
process_file /data/etc/date.conf
|
||||
process_file /data/etc/static_ip.conf
|
||||
|
Loading…
x
Reference in New Issue
Block a user