forked from Dan-in-CA/SIP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrtcdev.sh
More file actions
31 lines (29 loc) · 652 Bytes
/
rtcdev.sh
File metadata and controls
31 lines (29 loc) · 652 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#! /bin/sh
### BEGIN INIT INFO
# Provides: rtcdev
# Required-Start: kmod
# Required-Stop:
# Default-Start: S
# Default-Stop:
# Short-Description: creates RTC device
### END INIT INFO
. /lib/lsb/init-functions
case "$1" in
start)
if [ ! -e /dev/rtc0 ]; then
log_action_msg "Creating RTC device..."
echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device
fi
;;
restart|reload|force-reload)
echo "Error: argument '$1' not supported" >&2
exit 3
;;
stop)
# No-op
;;
*)
echo "Usage: $0 start|stop" >&2
exit 3
;;
esac