#!/bin/bash
source /root/envsetup/conf.sh

# apply MS default network parameters
sudo sed -i "s@address .*@address 192.168.1.10@" /etc/network/interfaces
sudo sed -i "s@netmask .*@netmask 255.255.255.0@" /etc/network/interfaces
sudo sed -i "s@gateway .*@gateway 192.168.1.1@" /etc/network/interfaces
# add a specific user
useradd -m msinstall
echo -e "msinstall\nmsinstall" | (passwd -q msinstall)
sed -i "s@/home/msinstall:@/home/msinstall:/bin/bash@" /etc/passwd
# sudo
usermod -aG sudo msinstall
echo 'msinstall    ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
# get MS_deploy
mv /var/tmp/MS_deploy.sh /home/msinstall/MS_deploy.sh
# correct rights
chown msinstall:msinstall /home/msinstall/MS_deploy.sh
echo "bash /home/msinstall/MS_deploy.sh" > /home/msinstall/.bash_profile
