Info Backup, change, sort,..... DHCP

Currently reading
Info Backup, change, sort,..... DHCP

31
10
NAS
DS218+ DSM 6.2.2-24922-4
Router
  1. RT2600ac
Hey,

Backup, change, sort,..... DHCP (need to test more) but seems to work.

  1. Activate admin account.
  2. Enable ssh
  3. Login with root & pass. = admin pass. => winSCP,...
  4. Go to /etc/dhcpd
  5. => file = dhcpdStatic.ori
  6. Logout
  7. Reboot router
 
31
10
NAS
DS218+ DSM 6.2.2-24922-4
Router
  1. RT2600ac
This can cleaner but it's a start.
This make a backup from dhcp reservation every day on 4 AM
If you run this the first time it add automatic to crontab
Before run check directory's!
Copy before run the file to your backup dir , need a check

#!/bin/bash

USBPLACE="/volumeUSB1/usbshare/@sharebin/Webdav/router"
WHATV="$USBPLACE/backup-dhcp.sh"
WHAT="0 4 * * * root /bin/sh $WHATV"
WHATF="/etc/crontab"

TFILE="dhcpdStatic.ori"
P1="/etc/dhcpd/$TFILE"
P2="$USBPLACE/$TFILE.txt"

count=$(grep -c "$WHATV" $WHATF)
if [ "$count" -eq 0 ];then
echo "$WHAT" >> $WHATF
cp -p -f $P2 $P1
fi

cp -p -f $P1 $P2
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Similar threads

Similar threads

Trending threads

Top