Skip to content

Instantly share code, notes, and snippets.

@godspeed1989
Last active November 30, 2020 15:02
Show Gist options
  • Save godspeed1989/5590281 to your computer and use it in GitHub Desktop.
Save godspeed1989/5590281 to your computer and use it in GitHub Desktop.
/etc/init.d/rcS
#!/bin/sh
echo "Starting rcS..."
echo "++ Mounting filesystem"
mount tmpfs /dev -t tmpfs
mount proc /proc -t proc
mount sysfs /sys -t sysfs
mkdir -p /dev/pts
mkdir -p /dev/i2c
echo "++ Setting up mdev"
echo /sbin/mdev > /proc/sys/kernel/hotplug
mdev -s
mount -a
echo "++ Starting syslogd"
syslogd
echo "++ Starting klogd"
klogd
echo "++ Starting telnet daemon"
telnetd -l /bin/sh
echo "++ Starting http daemon"
httpd -h /var/www
echo "++ Starting ftp daemon"
tcpsvd 0:21 ftpd ftpd -w /&
echo "++ Starting ssh daemon"
chmod 600 /etc/ssh_host_*
/usr/sbin/sshd
if [ -f /mnt/init.sh ]
then
echo "++ Running user script init.sh from SD Card"
source /mnt/init.sh
fi
echo "rcS Complete"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment