Mercurial > ~darius > hgwebdir.cgi > vanlogger
view install.sh @ 32:b6f96e8738ca
Add install script to create service entry and rc.local resurrecter
author | Daniel O'Connor <darius@dons.net.au> |
---|---|
date | Mon, 13 Dec 2021 18:17:12 +1030 |
parents | |
children | 7125b13d0528 |
line wrap: on
line source
#!/bin/sh root=$(cd $(dirname $0); pwd) # Create service files for running and logging mkdir -p /service/vanlogger/log cat >/service/vanlogger/run <<EOF #!/bin/sh exec 2>&1 exec /usr/bin/python $root/vanlogger.py EOF cat <<EOF >/service/vanlogger/log/run #!/bin/sh exec 2>&1 exec multilog t s25000 n4 /var/log/vanlogger EOF chmod 755 /service/vanlogger/run /service/vanlogger/log/run # Create rc.local hooks for reinstallation mkdir /data/rc.local.d /data/rcS.local.d cat >/data/rc.local.d/vanlogger <<EOF #!/bin/sh sh $root/install.sh EOF cat >/data/rc.local <<EOF #!/bin/sh for s in /data/rc.local.d/*; do \$s done EOF cat >/data/rcS.local <<EOF #!/bin/sh for s in /data/rcS.local.d/*; do \$s done EOF chmod 755 /data/rc.local.d/vanlogger /data/rc.local /data/rcS.local