Commit 11645e31 by tarokkk

Added ubuntu context folder

parent 3686a672
#!/bin/bash
#rm -f /etc/ssh/ssh_host_*
stop rsyslog
rm -fr /home/cloud/.bash_history /root/.bash_history /var/log/*
#!/bin/bash
echo "En vagyok a $0 !"
hostname "$HOSTNAME"
echo "$HOSTNAME" > /etc/hostname
sed "s/\(127\.0\.1\.1\).*/\1\t$HOSTNAME/" -i /etc/hosts
#!/bin/bash
echo "En vagyok a $0 !"
/etc/init.d/ssh stop
dpkg-reconfigure openssh-server
/etc/init.d/ssh start
#!/bin/bash
echo "En vagyok a $0 !"
echo "$USER:$USERPW" | chpasswd
#!/bin/bash
echo "En vagyok a $0 !"
mkdir -p "$HOME/.ssh"
echo "$SSHPRIV" > $HOME/.ssh/id_rsa
chmod 600 "$HOME/.ssh/id_rsa"
mkdir "$HOME/sshfs"
chown "$USER:$USER" -R "$HOME"
sed -i "s/^\(<\/pam_mount>.*\)/<volume user=\"$USER\" fstype=\"fuse\" path=\"sshfs#${NEPTUN}@${SERVER}:home\" mountpoint=\"~\/sshfs\" options=\"nonempty,reconnect,StrictHostKeyChecking=no\" \/>\n\1/" /etc/security/pam_mount.conf.xml
#!/bin/bash
echo "En vagyok a $0 !"
echo "export NEPTUN=$NEPTUN" >> $HOME/.profile
#!/bin/bash
echo "En vagyok a $0 !"
wget -q -O /dev/null "$BOOTURL"
#!/bin/bash
export BASEDIR=$(dirname $0)
export USER="cloud"
export HOME=$(awk -F: -v u=$USER '$1==u{print $6}' /etc/passwd)
cd "$BASEDIR"
mount -t iso9660 /dev/cdrom1 "$BASEDIR/mnt" 2> /dev/null
if [ $? -eq 0 -a -f "$BASEDIR/firstrun" -a -f "$BASEDIR/mnt/context.sh" ]; then
. "$BASEDIR/mnt/context.sh"
# hogy tudom kiexportalni ennel szebben ezeket a valtozokat?
eval `grep -o '^[a-zA-Z0-9]\+=' "$BASEDIR/mnt/context.sh" | while read x; do echo export ${x%=};done`
run-parts "$BASEDIR/init.d"
rm "$BASEDIR/firstrun"
else
echo "mar korabban lefutott!"
fi
umount /dev/cdrom1 2>/dev/null
eject /dev/cdrom1
exit 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment