source: /cluster/svnroot/bccd-ng/branches/sam-test_fw/packages/etc/init.d/bccd-passwd @ 2813

Last change on this file since 2813 was 2813, checked in by leemasa, 10 years ago

Miscommand to telinit fixed

  • Property svn:executable set to *
File size: 1.9 KB
Line 
1#!/bin/sh
2
3### BEGIN INIT INFO
4# Provides:          bccd-passwd
5# Required-Start:   
6# Required-Stop:
7# Default-Start:     S
8# Default-Stop:
9# Short-Description: Set bccd user password
10### END INIT INFO
11
12echo "run BCCD-PASSWD"
13
14if [ `cat /etc/bccd-stage` == "LIBERATED" ]; then
15        echo "We're liberated already."
16        exit 0
17fi
18
19if [ -f /testmode ]; then
20        echo "Test mode, no password"
21        echo "\n\n" | /bin/bccd-passwd-wrapper bccd
22        update-rc.d ssh defaults
23        sed -i 's/\/sbin\/getty 38400/\/sbin\/mingetty --autologin bccd/' /etc/inittab
24        telinit q
25exit 0
26fi
27
28# From the original BCCD
29
30for x in `cat /proc/cmdline` ; do \
31        if test "x$$x" = "xautomode" || test "x$$x" = "xquickboot" ; then \
32                echo "**skipping bccd password**" ; \
33                exit 1 ; \
34        fi ; \
35done
36
37echo
38echo
39echo ${BOLD}Please set the password for the default user ${NORMAL}
40echo ${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}-${BOLD}-${NORMAL}
41RC=1
42/bin/bccd-passwd-wrapper bccd
43update-rc.d ssh defaults
44#
45# Set up the same password for all users based upon the bccd password
46#
47sed -e "s|PASSWD|`grep ^bccd /etc/passwd | cut -d\: -f2`|g" /etc/passwd > /etc/passwd.bak
48test -f /etc/passwd.bak && mv /etc/passwd.bak /etc/passwd
49#
50# sync the keys.
51#
52#test -d /home/lambccd && rsync -plarv /home/bccd/.ssh/ /home/lambccd/.ssh/ && chown -R lambccd:lambccd /home/lambccd/.ssh/
Note: See TracBrowser for help on using the repository browser.