2018-03-08 17:53:23 +00:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
|
|
|
on_chroot << EOF
|
2018-04-03 14:02:23 +00:00
|
|
|
apt-get install insserv -y
|
2018-03-08 17:53:23 +00:00
|
|
|
cd /tmp/
|
2018-03-08 20:18:58 +00:00
|
|
|
wget -O install_yunohost https://install.yunohost.org/stretch
|
|
|
|
chmod +x /tmp/install_yunohost
|
2018-04-02 17:15:23 +00:00
|
|
|
./install_yunohost -a
|
|
|
|
rm -f /etc/ssh/ssh_host_*
|
2018-04-03 14:02:23 +00:00
|
|
|
EOF
|
|
|
|
|
|
|
|
echo "Enabling ssh login for root + setting default password"
|
|
|
|
on_chroot << EOF
|
2018-04-02 22:46:09 +00:00
|
|
|
touch /boot/ssh
|
|
|
|
sed -i '/PermitRootLogin/c\PermitRootLogin yes' /etc/ssh/sshd_config
|
|
|
|
echo "root:yunohost" | chpasswd
|
|
|
|
chage -d 0 root
|
2018-03-08 17:53:23 +00:00
|
|
|
EOF
|
2018-04-03 14:02:23 +00:00
|
|
|
|
|
|
|
echo "Cleaning ..."
|
|
|
|
on_chroot << EOF
|
|
|
|
apt-get clean
|
|
|
|
find /var/log -type f -exec rm {} \;
|
2018-04-07 20:53:07 +00:00
|
|
|
ps -ef --forest | grep qemu
|
2018-04-03 14:02:23 +00:00
|
|
|
EOF
|
2018-04-03 14:03:36 +00:00
|
|
|
|
|
|
|
# Gotta manually kill those stuff which are some sort of daemon running
|
|
|
|
# for slapd / nscd / nslcd ... otherwise the script is unable to unmount
|
|
|
|
# the rootfs/image after that ?
|
2018-04-07 20:53:07 +00:00
|
|
|
for PID in `ps -ef --forest | grep "qemu-arm-static" | grep "nginx\|nscd\|slapd\|nslcd" | awk '{print $2}'`
|
2018-04-03 14:03:36 +00:00
|
|
|
do
|
2018-04-07 20:53:07 +00:00
|
|
|
echo "Killing $PID"
|
2018-04-03 14:03:36 +00:00
|
|
|
kill -9 $PID
|
|
|
|
done
|