Last active
March 16, 2022 16:06
-
-
Save vandycknick/53b0b09fa52a2670fe3afca2ee93c64c to your computer and use it in GitHub Desktop.
Quickly install buxybox
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
#! /usr/bin/env bash | |
# Run with bash -c 'eval "$(curl -sfL https://gist.githubusercontent.com/vandycknick/53b0b09fa52a2670fe3afca2ee93c64c/raw/36ddeaf92e424e54bfeca64d6b0baf41119b764e/busybox-install.sh)"' | |
VERSION=1.35.0 | |
ARCHITECTURE=x86_64 | |
BIN_DIR=/tmp/bin | |
UTILS=( | |
"acpid" "addgroup" "adduser" "adjtimex" "ar" "arp" "arping" "ash" | |
"awk" "basename" "beep" "blkid" "brctl" "bunzip2" "bzcat" "bzip2" "cal" "cat" | |
"catv" "chat" "chattr" "chgrp" "chmod" "chown" "chpasswd" "chpst" "chroot" | |
"chrt" "chvt" "cksum" "clear" "cmp" "comm" "cp" "cpio" "crond" "crontab" | |
"cryptpw" "cut" "date" "dc" "dd" "deallocvt" "delgroup" "deluser" "depmod" | |
"devmem" "df" "dhcprelay" "diff" "dirname" "dmesg" "dnsd" "dnsdomainname" | |
"dos2unix" "dpkg" "du" "dumpkmap" "dumpleases" "echo" "ed" "egrep" "eject" | |
"env" "envdir" "envuidgid" "expand" "expr" "fakeidentd" "false" "fbset" | |
"fbsplash" "fdflush" "fdformat" "fdisk" "fgrep" "find" "findfs" "flash_lock" | |
"flash_unlock" "fold" "free" "freeramdisk" "fsck" "fsck.minix" "fsync" | |
"ftpd" "ftpget" "ftpput" "fuser" "getopt" "getty" "grep" "gunzip" "gzip" "hd" | |
"hdparm" "head" "hexdump" "hostid" "hostname" "httpd" "hush" "hwclock" "id" | |
"ifconfig" "ifdown" "ifenslave" "ifplugd" "ifup" "inetd" "init" "inotifyd" | |
"insmod" "install" "ionice" "ip" "ipaddr" "ipcalc" "ipcrm" "ipcs" "iplink" | |
"iproute" "iprule" "iptunnel" "kbd_mode" "kill" "killall" "killall5" "klogd" | |
"last" "length" "less" "linux32" "linux64" "linuxrc" "ln" "loadfont" | |
"loadkmap" "logger" "login" "logname" "logread" "losetup" "lpd" "lpq" "lpr" | |
"ls" "lsattr" "lsmod" "lzmacat" "lzop" "lzopcat" "makemime" "man" "md5sum" | |
"mdev" "mesg" "microcom" "mkdir" "mkdosfs" "mkfifo" "mkfs.minix" "mkfs.vfat" | |
"mknod" "mkpasswd" "mkswap" "mktemp" "modprobe" "more" "mount" "mountpoint" | |
"mt" "mv" "nameif" "nc" "netstat" "nice" "nmeter" "nohup" "nslookup" "od" | |
"openvt" "passwd" "patch" "pgrep" "pidof" "ping" "ping6" "pipe_progress" | |
"pivot_root" "pkill" "popmaildir" "printenv" "printf" "ps" "pscan" "pwd" | |
"raidautorun" "rdate" "rdev" "readlink" "readprofile" "realpath" | |
"reformime" "renice" "reset" "resize" "rm" "rmdir" "rmmod" "route" "rpm" | |
"rpm2cpio" "rtcwake" "run-parts" "runlevel" "runsv" "runsvdir" "rx" "script" | |
"scriptreplay" "sed" "sendmail" "seq" "setarch" "setconsole" "setfont" | |
"setkeycodes" "setlogcons" "setsid" "setuidgid" "sh" "sha1sum" "sha256sum" | |
"sha512sum" "showkey" "slattach" "sleep" "softlimit" "sort" "split" | |
"start-stop-daemon" "stat" "strings" "stty" "su" "sulogin" "sum" "sv" | |
"svlogd" "swapoff" "swapon" "switch_root" "sync" "sysctl" "syslogd" "tac" | |
"tail" "tar" "taskset" "tcpsvd" "tee" "telnet" "telnetd" "test" "tftp" "tftpd" | |
"time" "timeout" "top" "touch" "tr" "traceroute" "true" "tty" "ttysize" | |
"udhcpc" "udhcpd" "udpsvd" "umount" "uname" "uncompress" "unexpand" "uniq" | |
"unix2dos" "unlzma" "unlzop" "unzip" "uptime" "usleep" "uudecode" "uuencode" | |
"vconfig" "vi" "vlock" "volname" "watch" "watchdog" "wc" "wget" "which" "who" | |
"whoami" "xargs" "yes" "zcat" "zcip" | |
) | |
mkdir -p $BIN_DIR | |
function on_exit { | |
rm -rf $BIN_DIR | |
} | |
trap on_exit EXIT | |
curl -sfL https://busybox.net/downloads/binaries/$VERSION-$ARCHITECTURE-linux-musl/busybox -o $BIN_DIR/busybox | |
chmod +x $BIN_DIR/busybox | |
for util in ${UTILS[@]}; do | |
ln -sf $BIN_DIR/busybox $BIN_DIR/$util | |
done | |
echo "Launching new shell" | |
PATH=$BIN_DIR:$PATH bash -i |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment