diff --git a/bin/smart.sh b/bin/smart.sh index c003fc0..35bdae6 100644 --- a/bin/smart.sh +++ b/bin/smart.sh @@ -1,30 +1,41 @@ #!/bin/bash +# Edit vars: +# +# user user name z.B. "pi" +# +# wdir source path z.B. "/usr/local/energie" +# +# +# + +user="myadmin" + wdir="/usr/local/energie" + wlog="$wdir/log/smart.log" -cd $wdir/log +cd "$wdir/log" if [ "$1" != "daemon" ]; then - su -c "$0 daemon" myadmin + su -c "$0 daemon" "$user" else ( exec 2>&1 - exec 1>> $wlog + exec 1>>"$wlog" exec 0$wlog - $PHP $wdir/bin/smart.php 1>>$wlog 2>&1 + > "$wlog" + $PHP $wdir/bin/smart.php 1>>"$wlog" 2>&1 sleep 10 done ) &