我有这个脚本:
#!/bin/sh
while [ true ] ; do
urlfile=$( ls /root/wget/wget-download-link.txt | head -n 1 )
dir=$( cat /root/wget/wget-dir.txt )
if [ "$urlfile" = "" ] ; then
sleep 30
continue
fi
url=$( head -n 1 $urlfile )
if [ "$url" = "" ] ; then
mv $urlfile $urlfile.invalid
continue
fi
mv $urlfile $urlfile.busy
wget -b $url -P $dir -o /www/wget.log -c -t 100 -nc
mv $urlfile.busy $urlfile.done
done
Run Code Online (Sandbox Code Playgroud)
该脚本基本上wget-download-link.txt每30秒检查一次新的URL,如果有一个新的URL,它将用wget下载,问题是当我尝试在Putty上运行这个脚本时这样
/root/wget/wget_download.sh --daemon
Run Code Online (Sandbox Code Playgroud)
它仍然在前台运行,我仍然可以看到终端输出.如何让它在后台运行?
我有这个脚本:
#!/bin/bash
while [ true ]
do
if tail -1 /tmp/test | grep 'line3'
then
echo found
sleep 5
else
echo not found
fi
done
Run Code Online (Sandbox Code Playgroud)
它line3每5秒寻找一次.如何line3找不到脚本停止一次?
我有一个标题为test.html这个文件的html 文件:
<!DOCTYPE html>
<html>
<body onload="document.getElementById('saveForm').click();">
<form method="post" enctype="multipart-form-data" name="my_form" onsubmit="clearTextBoxCounter()" action="http://xxxxx" >
<input type=hidden name=teks value=><center><b>KIRIM SMS GRATIS</b></center><br><br>
Nomer HP:<br />
<input class="field text small" type="text" maxlength="20" name="Phonenumbers" value="085642383165"/>
<br />
<br />
Isi Pesan:<br />
<textarea rows="5" cols="20" onKeyPress=check_length(this.form); onKeyDown=check_length(this.form); name=Text >testing pesan 2</textarea>
<br />
<input id="saveForm" class="btTxt" type="submit" value="KIRIM" name="TOMBOL" />
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
正如你可以看到加载文件时它会自动点击提交按钮,并将其重定向到http://xxxxxx如何从终端运行这个html文件?我在openwrt上使用它,并在其上安装了webserver.
我的剧本:
<!DOCTYPE html>
<html>
<head>
<script>
$(document).ready(function () {
document.getElementById("saveForm").click();
});
</script>
</head>
<!--<body onload="document.getElementById('saveForm').click();">-->
<body>
<form method="post" enctype="multipart-form-data" name="my_form" onsubmit="clearTextBoxCounter()" action="http://www.sms-online.web.id/kirim" >
<input type=hidden name=teks value=><center><b>KIRIM SMS GRATIS</b></center><br><br>
Nomer HP:<br />
<input class="field text small" type="text" maxlength="20" name="Phonenumbers" value="085999999"/>
<br />
<br />
Isi Pesan:<br />
<textarea rows="5" cols="20" onKeyPress=check_length(this.form); onKeyDown=check_length(this.form); name=Text >sms content</textarea>
<br />
<input id="saveForm" class="btTxt" type="submit" value="KIRIM" name="TOMBOL" />
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
javascript没有完成它的工作,点击页面加载时的提交按钮,我无法弄清楚为什么,任何想法?
@ balintpekker仍然没有点击页面加载时的提交按钮,我的脚本:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
$(document).ready(function () {
document.getElementById("saveForm").click(); …Run Code Online (Sandbox Code Playgroud)