diff options
author | Andrew Cady <d@jerkface.net> | 2016-04-22 13:45:13 -0400 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2016-04-22 18:50:58 -0400 |
commit | f609b54511e04770950c9fbf6407977828f4d426 (patch) | |
tree | 27f2d6a78823af72c20520c6ed721c457b9d7460 /patchroot.sh | |
parent | 95973675ae78e9c9eaefb4472072275493371cdf (diff) |
add some scripts into root's homedir
Diffstat (limited to 'patchroot.sh')
-rwxr-xr-x | patchroot.sh | 38 |
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 | |||
3 | pkgs='avahi-daemon git tmux btrfs-tools/jessie-backports sshfs' | ||
4 | pkgs="$pkgs $(cat initrd-dependencies.txt)" | ||
5 | pkgs="$pkgs linux-image-$(uname -r)" | ||
6 | |||
7 | default_sources_list() | ||
8 | { | ||
9 | cat <<'END' | ||
10 | deb http://httpredir.debian.org/debian jessie main non-free | ||
11 | deb http://security.debian.org jessie/updates main non-free | ||
12 | deb http://httpredir.debian.org/debian jessie-backports main non-free | ||
13 | deb-src http://httpredir.debian.org/debian jessie main non-free | ||
14 | deb-src http://security.debian.org jessie/updates main non-free | ||
15 | deb-src http://httpredir.debian.org/debian jessie-backports main non-free | ||
16 | END | ||
17 | } | ||
18 | |||
19 | network_devs() | ||
20 | { | ||
21 | ip -oneline link | | ||
22 | while read _ dev _; do | ||
23 | echo ${dev%:} | ||
24 | done | ||
25 | } | ||
26 | |||
27 | if [ -e /root/sources.list ]; then | ||
28 | cp /root/sources.list /etc/apt/sources.list | ||
29 | else | ||
30 | default_sources_list > /etc/apt/sources.list | ||
31 | fi | ||
32 | |||
33 | if [ "$(ifquery -a --list)" = lo ]; then | ||
34 | # No configured interfaces. Do something! | ||
35 | dhclient $(network_devs) | ||
36 | fi | ||
37 | apt-get update | ||
38 | apt-get -y install --no-upgrade $pkgs | ||