some config files are now looked up in /boot as well

This commit is contained in:
Calin Crisan 2016-04-09 18:37:59 +03:00
parent 1589076e76
commit de4775cab7
11 changed files with 62 additions and 20 deletions

View File

@ -1,6 +1,7 @@
#!/bin/bash
sys_conf="/etc/os.conf"
boot_conf="/boot/os.conf"
conf="/data/etc/os.conf"
test -n "$os_version" || source /etc/init.d/base
@ -10,9 +11,13 @@ mount_fs() {
/bin/mount -a
test $? == 0 && msg_done || msg_fail
if [ -f $sys_conf ] && ! [ -f $conf ]; then
if ! [ -f $conf ]; then
if [ -f $boot_conf ]; then
cp $boot_conf $conf
elif [ -f $sys_conf ]; then
cp $sys_conf $conf
fi
fi
if [ -f $conf ]; then
source $conf

View File

@ -1,6 +1,7 @@
#!/bin/bash
sys_hostname_file="/etc/hostname"
boot_hostname_file="/boot/hostname"
hostname_file="/data/etc/hostname"
test -n "$os_version" || source /etc/init.d/base
@ -9,10 +10,16 @@ case "$1" in
start)
msg_begin "Setting hostname"
if ! [ -f $hostname_file ]; then
if [ -f $boot_hostname_file ]; then
cp $boot_hostname_file $hostname_file
elif [ -f $sys_hostname_file ]; then
cp $sys_hostname_file $hostname_file
fi
fi
if [ -f $hostname_file ]; then
hostname=$(cat $hostname_file)
elif [ -f $sys_hostname_file ]; then
hostname=$(cat $sys_hostname_file)
else
hostname="$os_prefix-$board_sn"
fi

View File

@ -1,6 +1,7 @@
#!/bin/bash
sys_conf="/etc/wpa_supplicant.conf"
boot_conf="/boot/wpa_supplicant.conf"
conf="/data/etc/wpa_supplicant.conf"
log="/var/log/wpa_supplicant.log"
@ -9,19 +10,28 @@ iface=wlan0
driver=wext
sys_watch_conf="/etc/watch.conf"
boot_watch_conf="/etc/watch.conf"
watch_conf="/data/etc/watch.conf"
link_watch=yes
link_watch_timeout=20
if [ -f $sys_watch_conf ] && ! [ -f $watch_conf ]; then
if ! [ -f $watch_conf ]; then
if [ -f $boot_watch_conf ]; then
cp $boot_watch_conf $watch_conf
elif [ -f $sys_watch_conf ]; then
cp $sys_watch_conf $watch_conf
fi
fi
test -f $watch_conf && source $watch_conf
if [ -f $sys_conf ] && ! [ -f $conf ]; then
if ! [ -f $conf ]; then
if [ -f $boot_conf ]; then
cp $boot_conf $conf
elif [ -f $sys_conf ]; then
cp $sys_conf $conf
fi
fi
test -f $conf || exit 0

View File

@ -1,6 +1,7 @@
#!/bin/bash
sys_conf="/etc/ppp/default"
boot_conf="/boot/ppp/default"
conf="/data/etc/ppp"
prog="/usr/sbin/pppd"
@ -11,8 +12,12 @@ watch_conf="/data/etc/watch.conf"
test -f $watch_conf && source $watch_conf
if [ -d $sys_conf ] && ! [ -d $conf ]; then
if ! [ -d $conf ]; then
if [ -d $boot_conf ]; then
cp -r $boot_conf $conf
elif [ -d $sys_conf ]; then
cp -r $sys_conf $conf
fi
fi
test -f $conf/modem || exit 0

View File

@ -3,6 +3,7 @@
mkdir -p /var/lib/dhcp
dh_conf="/var/cache/dhclient.conf"
sys_static_conf="/etc/static_ip.conf"
boot_static_conf="/boot/static_ip.conf"
static_conf="/data/etc/static_ip.conf"
watch_conf="/data/etc/watch.conf"
@ -17,8 +18,12 @@ wlan=wlan0
test -r $watch_conf && source $watch_conf
if [ -f $sys_static_conf ] && ! [ -f $static_conf ]; then
if ! [ -f $static_conf ]; then
if [ -f $boot_static_conf ]; then
cp $boot_static_conf $static_conf
elif [ -f $sys_static_conf ]; then
cp $sys_static_conf $static_conf
fi
fi
test -r $static_conf && source $static_conf

View File

@ -1,10 +1,15 @@
#!/bin/bash
sys_conf="/etc/date.conf"
boot_conf="/boot/date.conf"
conf="/data/etc/date.conf"
if [ -f $sys_conf ] && ! [ -f $conf ]; then
if ! [ -f $conf ]; then
if [ -f $boot_conf ]; then
cp $boot_conf $conf
elif [ -f $sys_conf ]; then
cp $sys_conf $conf
fi
fi
test -f $conf || exit 0

View File

@ -1,6 +1,7 @@
#!/bin/bash
sys_conf="/etc/motioneye.conf"
boot_conf="/boot/motioneye.conf"
conf="/data/etc/motioneye.conf"
motion_conf="/data/etc/motion.conf"
watch_conf="/data/etc/watch.conf"
@ -10,8 +11,12 @@ meyewatch_disable=""
dev_v4l_by_id="/dev/v4l/by-id/"
media_dir="/data/output"
if [ -f $sys_conf ] && ! [ -f $conf ]; then
if ! [ -f $conf ]; then
if [ -f $boot_conf ]; then
cp $boor_conf $conf
elif [ -f $sys_conf ]; then
cp $sys_conf $conf
fi
fi
test -f "$conf" || exit 0

View File

@ -12,7 +12,7 @@ echo "---- shutting down $os_name $os_version ----" >> $boot_log
(for i in $(ls -r /etc/init.d/S??*); do
[ ! -x "$i" ] && continue
[ -f /data/etc/no_$(basename $i) ] && continue
$i stop || break
$i stop
done& echo $! > $pid_file) | tee -a $boot_log &
pid=$(cat $pid_file)

View File

@ -53,7 +53,7 @@ function start() {
function stop() {
# stop the streameye background watch process
ps | grep streameye | grep -v $$ | grep -v S94streameye| grep -v grep | tr -s ' ' | sed -e 's/^\s//' | cut -d ' ' -f 1 | xargs -r kill
ps | grep streameye.sh | grep -v $$ | grep -v S94streameye| grep -v grep | tr -s ' ' | sed -e 's/^\s//' | cut -d ' ' -f 1 | xargs -r kill
# stop the raspimjpeg process
pid=$(ps | grep raspimjpeg.py | grep -v grep | tr -s ' ' | sed -e 's/^\s//' | cut -d ' ' -f 1)

View File

@ -53,7 +53,7 @@ function start() {
function stop() {
# stop the streameye background watch process
ps | grep streameye | grep -v $$ | grep -v grep | tr -s ' ' | sed -e 's/^\s//' | cut -d ' ' -f 1 | xargs -r kill
ps | grep streameye.sh | grep -v $$ | grep -v grep | tr -s ' ' | sed -e 's/^\s//' | cut -d ' ' -f 1 | xargs -r kill
# stop the raspimjpeg process
pid=$(ps | grep raspimjpeg.py | grep -v grep | tr -s ' ' | sed -e 's/^\s//' | cut -d ' ' -f 1)

View File

@ -53,7 +53,7 @@ function start() {
function stop() {
# stop the streameye background watch process
ps | grep streameye | grep -v $$ | grep -v grep | tr -s ' ' | sed -e 's/^\s//' | cut -d ' ' -f 1 | xargs -r kill
ps | grep streameye.sh | grep -v $$ | grep -v grep | tr -s ' ' | sed -e 's/^\s//' | cut -d ' ' -f 1 | xargs -r kill
# stop the raspimjpeg process
pid=$(ps | grep raspimjpeg.py | grep -v grep | tr -s ' ' | sed -e 's/^\s//' | cut -d ' ' -f 1)