Привет всем ситуация такая настраиваю Sasc-ng. Скопировал официальный скрипт поменял все пути но при старте скрипта появляться ошибка
mannaz@ubuntu:/usr/local/bin$ sudo bash runsasc
: command not found
: command not found
: command not found
: command not found
: command not found
: command not found
: command not found
: command not found
: command not found
: command not found
: command not found
: command not found
: command not found
: command not found
: command not found
: command not found
'unsasc: line 29: syntax error near unexpected token `
'unsasc: line 29: `function DriverLoaded()
Вот сам скрипт
# Script to automate running of SASC-NG and Drivers
# Driver directory
DRIVERDIR="/home/mannaz/dvb"
# Path to SASC-NG binary
SASCPRG="/home/mannaz/dvb"
# Path to CAM Directory
CAMDIR="/home/mannaz/dvb/camfiles/"
# Number of DVB Cards you have in your system dedicated to SASC-NG
ADAPTERS="1"
# Startup Options passed to SASC-NG. Adjust according to your devices.
#OPTIONS="-r 0 -v 2 -o"
OPTIONS="-j 0:1 --cam-budget --sid-allpid --sid-nocache --cam-dir"
# Number of times runsasc will attempt to restart SASC-NG after a crash has occured (set to 0 for no limit)
MAXTRIES=10
# Minimum runtime required (in seconds) for SASC-NG to continue restart attempts
MINRUN=20
## End Configuration Section ##
SASCCMD="$SASCPRG $OPTIONS $CAMDIR"
KILL="/usr/bin/killall -q -TERM"
# Detect whether the DVBLooopback driver is already loaded
# and return 0 if it *is* loaded, 1 if not:
function DriverLoaded()
{
grep -qse dvbloopback /proc/modules
}
# Load all DVBLoopback driver modules needed for your hardware:
function LoadDriver()
{
modprobe dvbloopback num_adapters=$ADAPTERS
sleep 5
}
# Unload all DVBLoopback driver modules loaded in LoadDriver():
function UnloadDriver()
{
rmmod dvbloopback
}
# Load driver if it hasn't been loaded already:
if ! DriverLoaded; then
LoadDriver
fi
LASTRESTART=$(date +%s)
LOOPCOUNT=0
while (true) do
if [ $LOOPCOUNT -le $MAXTRIES ] || [ $MAXTRIES -eq 0 ] ; then
eval "screen -D -m -S sasc-ng $SASCCMD &"
# Wait for SASC-NG to initialize then do rest
sleep 10
touch /tmp/SASC_COMPLETE
else
$KILL runsasc
fi
# Remember PID of SASC-NG process
PID=$!
# Wait for SASC-NG to end or signal to arrive
wait $PID
# Remember return value of SASC-NG
RET=$?
if test $RET -eq 0 -o $RET -eq 2; then exit; fi
TIMEOFDEATH=$(date +%s)
RUNTIME=$((TIMEOFDEATH - LASTRESTART))
if [ $TIMEOFDEATH -le $(($LASTRESTART + $MINRUN)) ] ; then
echo "`date` SASC-NG crashed in $RUNTIME seconds. Minimum required runtime for SASC-NG is $MINRUN seconds. Killing runsasc process..."
$KILL runsasc
fi
echo "`date` Reloading DVBLoopback drivers"
$KILL sasc-ng
sleep 10
UnloadDriver
LoadDriver
LASTRESTART=$(date +%s)
LOOPCOUNT=$((LOOPCOUNT+1))
echo "`date` Restarting SASC-NG $LOOPCOUNT time(s). Maximum retries set to $MAXTRIES"
done