]>
git.ipfire.org Git - people/mfischer/ipfire-2.x.git/blob - src/scripts/settime
5 # This file is part of the IPCop Project
7 # This code is distributed under the terms of the GPL
9 # (c) Eric Oberlander June 2002
10 # (c) Eric Oberlander December 2002 - internationalisation added
12 # /usr/local/bin/settime
15 green
=$
(cat /var
/ipfire
/ethernet
/settings |
grep GREEN_NETADDRESS
)
16 if [ -z "$green" ]; then
19 green
=${green##*=}; green
="${green%.*}.[0-9]"
20 if [ -n "$(cat /var/ipfire/time/settime.conf | grep $green)" ]; then
21 ongreen
=0 # NTP on Green
26 orange
=$
(cat /var
/ipfire
/ethernet
/settings |
grep ORANGE_NETADDRESS
)
27 if [ -z "$orange" ]; then
30 orange
=${orange##*=}; orange
="${orange%.*}.[0-9]"
31 if [ -n "$(cat /var/ipfire/time/settime.conf | grep $orange)" ]; then
32 onorange
=0 # NTP on Orange
37 tlanguage
=$
(cat /var
/ipfire
/main
/settings |
grep LANGUAGE
)
38 tlanguage
=${tlanguage##*=}
41 if [ -e /var
/ipfire
/red
/active
] ||
[ "$ongreen" -eq 0 ] ||
[ "$onorange" -eq 0 ]; then
42 /usr
/bin
/ntpdate
-su $1 $2
45 if [ "$ntpdatetest" -eq 0 ]; then
47 en
) date "+%X %Z on %d %B %Y" > /var
/ipfire
/time
/lastset
;
48 logger
-t ipfire
"NTP synchronisation event" ;;
49 da
) date "+%k:%M:%S på %d/%m/%y" > /var
/ipfire
/time
/lastset
;
50 logger
-t ipfire
"NTP synkronisering" ;;
51 de
) date "+%X Uhr am %d.%m.%Y" > /var
/ipfire
/time
/lastset
;
52 logger
-t ipfire
"NTP Synchronisierung" ;;
53 fr
) date "+%X le %e/%m/%y" > /var
/ipfire
/time
/lastset
;
54 logger
-t ipfire
"synchronisation NTP" ;;
55 it
) date "+%X il %d-%m-%Y" > /var
/ipfire
/time
/lastset
;
56 logger
-t ipfire
"sincronizzazione NTP" ;;
57 nl ) date "+%X %e-%m-%Y" > /var
/ipfire
/time
/lastset
;
58 logger
-t ipfire
"NTP synchronisatie" ;;
59 no
) date "+%X på %d-%m-%y" > /var
/ipfire
/time
/lastset
;
60 logger
-t ipfire
"NTP synkronisering" ;;
61 sv
) date "+%H.%M.%S på %y-%m-%d" > /var
/ipfire
/time
/lastset
;
62 logger
-t ipfire
"NTP synkronisering" ;;
63 es
) date "+%X %e/%-m/%y" > /var
/ipfire
/time
/lastset
;
64 logger
-t ipfire
"NTP sincronizado" ;;
65 * ) date "+%X %Z, %Y-%m-%d" > /var
/ipfire
/time
/lastset
;
66 logger
-t ipfire
"NTP synchronisation" ;;
69 /sbin
/hwclock --systohc
70 rm -f /var
/ipfire
/time
/settimenow
71 # reset counter variable
72 cp /var
/ipfire
/time
/counter.conf
/var
/ipfire
/time
/counter
75 de
) logger
-t ipfire
"ntpdate fehlerhaft" ;;
76 fr
) logger
-t ipfire
"ntpdate erreur" ;;
77 it
) logger
-t ipfire
"ntpdate errato" ;;
78 * ) logger
-t ipfire
"ntpdate error" ;;
83 echo Missing parameter