File: postinst

package info (click to toggle)
chrony 1.10-3
  • links: PTS
  • area: main
  • in suites: potato
  • size: 1,504 kB
  • ctags: 2,064
  • sloc: ansic: 15,081; sh: 152; makefile: 107
file content (21 lines) | stat: -rw-r--r-- 693 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
set -e
# postinst for chrony John Hasler jhasler@debian.org 3 Dec 1998
install-info --description="Set your clock from the Net" \
	     --section "General Commands" \
             --quiet /usr/info/chrony.info

if [ -x /usr/bin/update-menus ] ; then 
    /usr/bin/update-menus 
fi
# If chrony.keys is the dist file generate a random passord and put it there.
if [ "`cat /etc/chrony/chrony.keys`" = "1 password_here" ] ; then
    until [ `expr "$PASSWORD" : ".*"` -ge 8 ]
    do
	PASSWORD=`head -c 100 /dev/urandom | tr -dc '[:alnum:]' | head -c 8`
    done
    echo "1 $PASSWORD" > /etc/chrony/chrony.keys
fi
update-rc.d chrony defaults 83 >/dev/null
/etc/init.d/chrony start
exit 0