-
-
Save agriffis/403326aa79cbd66ad9af326408532bdc to your computer and use it in GitHub Desktop.
chrome os startup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# chr -- wrapper for enter-chroot to run setup after reboot | |
# | |
set -e | |
main() { | |
declare name | |
case $1 in | |
-n) name=$2; shift 2 ;; | |
*) name=$(sudo edit-chroot -a | head -n1) ;; | |
esac | |
mount | grep -Fq "crouton/chroots/$name" || first | |
enter "$@" | |
exit # in case script changes | |
} | |
first() { | |
sudo sh -c ' | |
mkdir -p /usr/local/etc | |
echo "chronos ALL=(ALL) NOPASSWD:ALL" > /usr/local/etc/95_cros_nopasswd | |
mount -o bind /usr/local/etc/95_cros_nopasswd /etc/sudoers.d/95_cros_base | |
' | |
enter -b sleep 365d | |
enter -b /usr/bin/syncthing -no-browser -no-restart -logflags=0 | |
enter -b /usr/bin/syncthing-inotify -logflags=0 | |
enter -b dropbox start | |
} | |
enter() { | |
sudo enter-chroot -n "$name" "$@" | |
} | |
main "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment