blob: e1e39345b7bcadb3da5028f151c0dc61b09fd51b [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001#!/bin/sh
Patrick Williams45852732022-04-02 08:58:32 -05002#
3# SPDX-License-Identifier: GPL-2.0-only
4#
5
Patrick Williamsc124f4f2015-09-15 14:41:29 -05006### BEGIN INIT INFO
7# Provides: save-rtc
8# Required-Start:
9# Required-Stop: $local_fs hwclock
10# Default-Start: S
11# Default-Stop: 0 6
12# Short-Description: Store system clock into file
13# Description:
14### END INIT INFO
15
Brad Bishop19323692019-04-05 15:28:33 -040016TIMESTAMP_FILE=/etc/timestamp
17
18[ -f /etc/default/timestamp ] && . /etc/default/timestamp
19
Patrick Williamsc124f4f2015-09-15 14:41:29 -050020# Update the timestamp
Brad Bishop19323692019-04-05 15:28:33 -040021date -u +%4Y%2m%2d%2H%2M%2S 2>/dev/null > "$TIMESTAMP_FILE"