-#!/bin/bash
+#!/bin/bash -ex
+
+if [[ $# -ne 0 ]]; then
+ echo "Usage: $0"
+ exit 1
+fi
+
+if [[ ${UID} -ne 0 ]]; then
+ exec sudo "$0" "$@"
+fi
+
pkgs=(
ipython
ipython3
gimp
inkscape
mpv
+ sshfs
steam
autoconf
dnsutils
flex
gcc
+ gdb
gettext
g++
git
git-email
git-svn
- gdb
+ gnupg
keychain
libtool
mosh
subversion
texinfo
tree
+ unrar
+ unzip
vim
zeal
+ zip
openjdk-11-jre-headless
pkg-config
zlib1g-dev
)
-exec sudo bash -c '
-set -ex
-printf "Defaults !tty_tickets\nDefaults timestamp_timeout=360\n" > /etc/sudoers.d/vapier
+
+printf "Defaults !tty_tickets\nDefaults timestamp_timeout=360\n" >/etc/sudoers.d/vapier
chmod 440 /etc/sudoers.d/vapier
# Add non-free sources for Steam.
sed -i "/^deb .*\/debian .* main$/s:$: contrib non-free:" /etc/apt/sources.list
dpkg --add-architecture i386
-curl "https://dl-ssl.google.com/linux/linux_signing_key.pub" | apt-key add -
+curl -s "https://dl-ssl.google.com/linux/linux_signing_key.pub" | apt-key add -
echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >/etc/apt/sources.list.d/google-chrome.list
+curl -s "https://packages.cloud.google.com/apt/doc/apt-key.gpg" | apt-key add -
+echo "deb [arch=amd64] https://packages.cloud.google.com/apt cloud-sdk main" >/etc/apt/sources.list.d/google-cloud-sdk.list
+
apt-get update
-apt-get dist-upgrade
+apt-get -y dist-upgrade
-apt-get -y install google-chrome-stable "$@"
+apt-get -y install google-chrome-stable google-cloud-sdk
ln -sf ~vapier/.profile.d/ROOT-bash_profile ~root/.bash_profile
for f in .gitconfig .inputrc .nanorc ; do
ln -sf ~vapier/${f} ~root/${f}
done
rm -f ~root/.profile ~root/.bashrc
-echo . ~vapier/.profile.d/ROOT-bashrc > ~root/.bashrc
+echo . ~vapier/.profile.d/ROOT-bashrc >~root/.bashrc
rm -f /etc/motd
-echo "[crostini]" > /etc/ps1_append
+echo "[crostini]" >/etc/ps1_append
rm -f /etc/ssh/sshd_not_to_be_run
/usr/sbin/sshd
-
-' bash "${pkgs[@]}"