File: /www/pages/cgi-bin/activate_ssh_again.cgi
#!/bin/sh
##############################################################################
#category "BitCain5.com for Bitmain Antminer's "
#package "BitCain5.com custom Firmware"
#author Miguel Padilla <miguel.padilla@zwilla.de>
#copyright (c) 2013 - 2021 Miguel Padilla
#link "https://shop.zwilla.de"
#github "https://github/zwilla"
#twitter "https://twitter.com/mytokenwallet"
#license: closed
##############################################################################
set -x
fuser -vk 22/tcp | sh /etc/init.d/network.sh | /etc/init.d/avahi restart > /dev/null | sh /etc/init.d/dropbear start | /usr/sbin/lighttpd -f /etc/lighttpd.conf
cat <<-EOH
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="3; url=minerStatus.cgi">
<script type="text/javascript">
window.location.href = "minerStatus.cgi"
</script>
<title>SSH is activated!</title>
</head>
<H1>Enable SSH</H1>
<body>
<p>If you are not redirected automatically, follow the</p>
<a href='minerStatus.cgi'>link</a>
</body>
</html>
EOH
exec 2>&1
exit 0;