add chamge password script

git-svn-id: https://svn.disconnected-by-peer.at/svn/linamh/trunk/genlink@2626 6952d904-891a-0410-993b-d76249ca496b
This commit is contained in:
geos_one 2010-10-30 12:14:12 +00:00
parent 29b3aabbf7
commit f418dc884b
6 changed files with 140 additions and 4 deletions

View File

@ -92,7 +92,7 @@ stage4/use:
# then it will be defined elsewhere. # then it will be defined elsewhere.
# example: # example:
# stage4/packages: livecd-tools dhcpcd acpid apmd gentoo-sources coldplug fxload irssi gpm syslog-ng parted links raidtools dosfstools nfs-utils jfsutils xfsprogs e2fsprogs reiserfsprogs ntfsprogs pwgen rp-pppoe screen mirrorselect penggy iputils hwdata-knoppix hwsetup lvm2 evms vim pptpclient mdadm ethtool wireless-tools prism54-firmware wpa_supplicant # stage4/packages: livecd-tools dhcpcd acpid apmd gentoo-sources coldplug fxload irssi gpm syslog-ng parted links raidtools dosfstools nfs-utils jfsutils xfsprogs e2fsprogs reiserfsprogs ntfsprogs pwgen rp-pppoe screen mirrorselect penggy iputils hwdata-knoppix hwsetup lvm2 evms vim pptpclient mdadm ethtool wireless-tools prism54-firmware wpa_supplicant
stage4/packages: layman openssh dhcpcd micro_evtd linux-buffalo_ls_pro_live buffalo_ls_pro_live-sources gpm syslog-ng gdisk parted atop links dosfstools nfs-utils jfsutils xfsprogs e2fsprogs reiserfsprogs reiser4progs pwgen screen mirrorselect iputils lvm2 vim mdadm ethtool ntp smartmontools hddtemp stage4/packages: layman openssh dhcpcd udev micro_evtd expect linux-buffalo_ls_pro_live buffalo_ls_pro_live-sources gpm syslog-ng gdisk parted atop links dosfstools nfs-utils jfsutils xfsprogs e2fsprogs reiserfsprogs reiser4progs pwgen screen mirrorselect iputils lvm2 vim mdadm ethtool ntp smartmontools hddtemp
# A fsscript is simply a shell script that is copied into the chroot of the stage4 # A fsscript is simply a shell script that is copied into the chroot of the stage4
# after the kernel(s) and any external modules have been compiled and is # after the kernel(s) and any external modules have been compiled and is
@ -149,7 +149,7 @@ stage4/modblacklist:
# correctly for us. Since we do not use this, it is left blank below. # correctly for us. Since we do not use this, it is left blank below.
# example: # example:
# stage4/rcadd: # stage4/rcadd:
stage4/rcadd: micro_evtd|boot hwclock|boot syslog-ng|boot sysfs|boot net.eth0|boot dbus|default linux-logo|default ntpd|default ntp-client|default smartd|default hddtemp|default sshd|default stage4/rcadd: udev|sysinit micro_evtd|boot hwclock|boot root|boot procfs|boot mtab|boot fsck|boot swap|boot syslog-ng|default net.eth0|default dbus|default linux-logo|default ntpd|default ntp-client|default smartd|default hddtemp|default sshd|default
# This is for removing init script from runlevels. It is executed after the # This is for removing init script from runlevels. It is executed after the
# defaults shipped with catalyst, so it is possible to remove the defaults using # defaults shipped with catalyst, so it is possible to remove the defaults using

View File

@ -2,3 +2,20 @@
cd /boot cd /boot
ln -sf uImage-*.buffalo uImage.buffalo ln -sf uImage-*.buffalo uImage.buffalo
ln -sf initrd-*.buffalo initrd.buffalo ln -sf initrd-*.buffalo initrd.buffalo
# no search for .svn dir
# as a subversiontree is used for /etc/portage & /var/lib/layman/go-genlink
# so remove by hand
rm -rf /.svn
rm -rf /etc/.svn
rm -rf /etc/conf.d/.svn
rm -rf /etc/layman/.svn
rm -rf /etc/profile.d/.svn
rm -rf /var/.svn
rm -rf /var/lib/.svn
rm -rf /var/lib/layman/.svn
rm -rf /usr/.svn
rm -rf /usr/local/.svn
rm -rf /usr/local/bin/.svn
# chamge password for root user
/usr/local/bin/changepassword root goLsProLive

View File

@ -0,0 +1,49 @@
#!/usr/bin/expect -f
# Password change shell script, tested on Linux and FreeBSD
# ----------------------------------
# It need expect tool. If you are using Linux use following command
# to install expect
# apt-get install expect
# FreeBSD user can use ports or following command:
# pkg_add -r -v expect
# ----------------------------------
# If you are using linux change first line
# From:
#!/usr/local/bin/expect -f
# To:
#!/usr/bin/expect -f
# -----------------------------------------------
# Copyright (c) 2006 nixCraft project
# This script is licensed under GNU GPL version 2.0 or above
# -------------------------------------------------------------------------
# This script is part of nixCraft shell script collection (NSSC)
# Visit http://bash.cyberciti.biz/ for more information.
# -------------------------------------------------------------------------
# display usage
if {$argc!=2} {
send_user "usage: $argv0 username password \n"
exit
}
# script must be run by root user
set whoami [exec id -u]
if {$whoami!=0} {
send_user "You must be a root user to run this script\n"
exit
}
#
set timeout -1
match_max 100000
# stopre password
set password [lindex $argv 1]
# username
set user [lindex $argv 0]
# opem shell
spawn $env(SHELL)
# send passwd command
send -- "passwd $user\r"
expect "assword:"
send "$password\r"
expect "assword:"
send "$password\r"
send "\r"
expect eof

View File

@ -92,7 +92,7 @@ stage4/use:
# then it will be defined elsewhere. # then it will be defined elsewhere.
# example: # example:
# stage4/packages: livecd-tools dhcpcd acpid apmd gentoo-sources coldplug fxload irssi gpm syslog-ng parted links raidtools dosfstools nfs-utils jfsutils xfsprogs e2fsprogs reiserfsprogs ntfsprogs pwgen rp-pppoe screen mirrorselect penggy iputils hwdata-knoppix hwsetup lvm2 evms vim pptpclient mdadm ethtool wireless-tools prism54-firmware wpa_supplicant # stage4/packages: livecd-tools dhcpcd acpid apmd gentoo-sources coldplug fxload irssi gpm syslog-ng parted links raidtools dosfstools nfs-utils jfsutils xfsprogs e2fsprogs reiserfsprogs ntfsprogs pwgen rp-pppoe screen mirrorselect penggy iputils hwdata-knoppix hwsetup lvm2 evms vim pptpclient mdadm ethtool wireless-tools prism54-firmware wpa_supplicant
stage4/packages: openssh dhcpcd micro_evtd linux-buffalo_ls_xhl sim_buffalo gpm syslog-ng gdisk parted links dosfstools nfs-utils jfsutils xfsprogs e2fsprogs reiserfsprogs reiser4progs pwgen screen mirrorselect iputils lvm2 vim mdadm ethtool ntp smartmontools hddtemp stage4/packages: layman openssh dhcpcd micro_evtd linux-buffalo_ls_xhl sim_buffalo gpm syslog-ng gdisk parted links dosfstools nfs-utils jfsutils xfsprogs e2fsprogs reiserfsprogs reiser4progs pwgen screen mirrorselect iputils lvm2 vim mdadm ethtool ntp smartmontools hddtemp
# A fsscript is simply a shell script that is copied into the chroot of the stage4 # A fsscript is simply a shell script that is copied into the chroot of the stage4
# after the kernel(s) and any external modules have been compiled and is # after the kernel(s) and any external modules have been compiled and is

21
Documentation/ls_xhl/fsscript Executable file
View File

@ -0,0 +1,21 @@
#!/bin/sh
cd /boot
ln -sf uImage-*.buffalo uImage.buffalo
ln -sf initrd-*.buffalo initrd.buffalo
# no search for .svn dir
# as a subversiontree is used for /etc/portage & /var/lib/layman/go-genlink
# so remove by hand
rm -rf /.svn
rm -rf /etc/.svn
rm -rf /etc/conf.d/.svn
rm -rf /etc/layman/.svn
rm -rf /etc/profile.d/.svn
rm -rf /var/.svn
rm -rf /var/lib/.svn
rm -rf /var/lib/layman/.svn
rm -rf /usr/.svn
rm -rf /usr/local/.svn
rm -rf /usr/local/bin/.svn
# chamge password for root user
/usr/local/bin/changepassword root goLsXhl

View File

@ -0,0 +1,49 @@
#!/usr/bin/expect -f
# Password change shell script, tested on Linux and FreeBSD
# ----------------------------------
# It need expect tool. If you are using Linux use following command
# to install expect
# apt-get install expect
# FreeBSD user can use ports or following command:
# pkg_add -r -v expect
# ----------------------------------
# If you are using linux change first line
# From:
#!/usr/local/bin/expect -f
# To:
#!/usr/bin/expect -f
# -----------------------------------------------
# Copyright (c) 2006 nixCraft project
# This script is licensed under GNU GPL version 2.0 or above
# -------------------------------------------------------------------------
# This script is part of nixCraft shell script collection (NSSC)
# Visit http://bash.cyberciti.biz/ for more information.
# -------------------------------------------------------------------------
# display usage
if {$argc!=2} {
send_user "usage: $argv0 username password \n"
exit
}
# script must be run by root user
set whoami [exec id -u]
if {$whoami!=0} {
send_user "You must be a root user to run this script\n"
exit
}
#
set timeout -1
match_max 100000
# stopre password
set password [lindex $argv 1]
# username
set user [lindex $argv 0]
# opem shell
spawn $env(SHELL)
# send passwd command
send -- "passwd $user\r"
expect "assword:"
send "$password\r"
expect "assword:"
send "$password\r"
send "\r"
expect eof