summaryrefslogtreecommitdiff
path: root/patchroot.sh
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2016-04-22 13:45:13 -0400
committerAndrew Cady <d@jerkface.net>2016-04-22 18:50:58 -0400
commitf609b54511e04770950c9fbf6407977828f4d426 (patch)
tree27f2d6a78823af72c20520c6ed721c457b9d7460 /patchroot.sh
parent95973675ae78e9c9eaefb4472072275493371cdf (diff)
add some scripts into root's homedir
Diffstat (limited to 'patchroot.sh')
-rwxr-xr-xpatchroot.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/patchroot.sh b/patchroot.sh
new file mode 100755
index 0000000..e211377
--- /dev/null
+++ b/patchroot.sh
@@ -0,0 +1,38 @@
1#!/bin/sh
2
3pkgs='avahi-daemon git tmux btrfs-tools/jessie-backports sshfs'
4pkgs="$pkgs $(cat initrd-dependencies.txt)"
5pkgs="$pkgs linux-image-$(uname -r)"
6
7default_sources_list()
8{
9 cat <<'END'
10deb http://httpredir.debian.org/debian jessie main non-free
11deb http://security.debian.org jessie/updates main non-free
12deb http://httpredir.debian.org/debian jessie-backports main non-free
13deb-src http://httpredir.debian.org/debian jessie main non-free
14deb-src http://security.debian.org jessie/updates main non-free
15deb-src http://httpredir.debian.org/debian jessie-backports main non-free
16END
17}
18
19network_devs()
20{
21 ip -oneline link |
22 while read _ dev _; do
23 echo ${dev%:}
24 done
25}
26
27if [ -e /root/sources.list ]; then
28 cp /root/sources.list /etc/apt/sources.list
29else
30 default_sources_list > /etc/apt/sources.list
31fi
32
33if [ "$(ifquery -a --list)" = lo ]; then
34 # No configured interfaces. Do something!
35 dhclient $(network_devs)
36fi
37apt-get update
38apt-get -y install --no-upgrade $pkgs