Skip to content

Instantly share code, notes, and snippets.

@alex2844
Last active June 29, 2018 12:40
Show Gist options
  • Save alex2844/231a57937b042f0bdf362899e3a5ed70 to your computer and use it in GitHub Desktop.
Save alex2844/231a57937b042f0bdf362899e3a5ed70 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
mount -o remount,rw /
cat <<EOT > /usr/local/bin/run
#!/usr/bin/env bash
rm -f /tmp/run
if [ "\$1" == "x" ]; then
sudo startunity -n bionic -X xorg
exit;
fi
if [ "\$1" == "t" ]; then
if [ ! -z "\$2" ]; then
sudo enter-chroot xiwi -T \$2
else
sudo startunity -n bionic -X xiwi-tab
fi
exit;
fi
if [ ! -z "\$@" ]; then
sed -i "//tmp/run/d" /usr/local/chroots/bionic/home/*/.bashrc
echo 'if [ -e "/tmp/run" ]; then exec /tmp/run; else cd ~/Downloads; fi' >> /usr/local/chroots/bionic/home/*/.bashrc
echo "#!/bin/bash" >> /tmp/run
echo "pwd="\$(pwd) >> /tmp/run
echo 'cd \${pwd///home/chronos/user//home/*}' >> /tmp/run
echo \$@ >> /tmp/run
echo "logout" >> /tmp/run
chmod +x /tmp/run
fi
sudo enter-chroot
EOT
chmod +x /usr/local/bin/run
wget https://raw.githubusercontent.com/dnschneid/crouton/master/installer/crouton
if [ -e "/usr/local/chroots/bionic" ]; then
sudo sh crouton -u -n bionic
else
sudo sh crouton -r bionic -t xiwi,unity,xorg
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment