Forum

Full Version: Auto dir creation on start up?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
for my openvpn to run I need below commands to be executed on start-up:

mkdir /dev/net
mknod /dev/net/tun c 10 200
chmod 0666 /dev/net/tun

Can I set that up in rc.local and how please?

Thanks
Yes you can

Just add the three lines to the end of /etc/rc.local

Code:
sudo nano /etc/rc.local
So the file should look like this?

sudo nano /etc/rc.local mkdir /dev/net
sudo nano /etc/rc.local mknod /dev/net/tun c 10 200
sudo nano /etc/rc.local chmod 0666 /dev/net/tun
exit 0

Thanks.

EDIT: ahhhh nano is an editor, got it, thanks Smile

(7th Mar, 2016 11:43 PM)Nachteule Wrote: [ -> ]Yes you can

Just add the three lines to the end of /etc/rc.local

Code:
sudo nano /etc/rc.local

Hi,
Edited file looks like this now:
/etc/rc.local mkdir /dev/net
/etc/rc.local mknod /dev/net/tun c 10 200
/etc/rc.local chmod 0666 /dev/net/tun
exit 0

Strange, I can't see the file in /etc in terminal but, the sudo nano /etc/rc.local edits it... im logged as root. Is there any reason for that?
Thank you.

EDIT: damn, it is too early here, of course it looks like this:
mkdir /dev/net
mknod /dev/net/tun c 10 200
chmod 0666 /dev/net/tun
exit 0:
Reference URL's