Skip to content

Commit

Permalink
bugfix: dhcp script
Browse files Browse the repository at this point in the history
  • Loading branch information
gojigeje committed Mar 3, 2015
1 parent 9f1a15e commit 27bd579
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions plugin/dhcp-router.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,19 @@

# aksi_array+=("twit_dhcp")

dhcptemp="temp/dhcp.table"
dhcptoday="temp/dhcp.today.$tahun$bulan$tanggal"
firsttime=false

twit_dhcp_main() {

if [[ ! -f "$dhcptoday" ]]; then
echo "[dhcp] file dhcp.today ga ada, bikin, hapus yg kemarin"
rm temp/dhcp.today.* > /dev/null
touch "$dhcptoday"
dhcptemp="temp/dhcp.table"
dhcptoday="temp/dhcp.today.$tahun$bulan$tanggal"
firsttime=false

firsttime=true
fi
if [[ ! -f "$dhcptoday" ]]; then
echo "[dhcp] file dhcp.today ga ada, bikin, hapus yg kemarin"
rm temp/dhcp.today.* > /dev/null
touch "$dhcptoday"

twit_dhcp_main() {
firsttime=true
fi

echo "[dhcp] [$jam:$menit]"
# get dhcp table
Expand Down Expand Up @@ -75,7 +74,7 @@ twit_dhcp_main() {
if [[ $host == " " ]]; then
host="unknown?"
fi

ip=$(echo "$line" | cut -d " " -f2)
mac=$(echo "$line" | cut -d " " -f3)
lease=$(echo "$line" | cut -d " " -f4)
Expand Down

0 comments on commit 27bd579

Please sign in to comment.