Server IP : 127.0.0.2 / Your IP : 3.145.38.251 Web Server : Apache/2.4.18 (Ubuntu) System : User : www-data ( ) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/bin/ |
Upload File : |
#!/bin/sh # # manifest - import/export a list of packages # Copyright (C) 2016 Dustin Kirkland # # Authors: Dustin Kirkland <kirkland@byobu.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, version 3 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. set -e if ! command -v pastebinit >/dev/null 2>&1; then echo "ERROR: pastebinit not found. Hint:" 1>&2 echo " sudo apt install pastebinit" 1>&2 exit 1 fi export_packages() { if [ "$OBJECT" = "-" ]; then dpkg -l elif echo "$OBJECT" | grep -qs ".*://.*"; then dpkg -l | gzip -9 | base64 | pastebinit -b "$OBJECT" else dpkg -l > "$OBJECT" fi } import_packages() { if [ "$OBJECT" = "-" ]; then sudo apt install $(cat /dev/stdin | grep "^ii\s" | col2) elif echo "$OBJECT" | grep -qs ".*://.*"; then sudo apt install $(wget -q -O- "$OBJECT" | grep -A 999999999 '<div class="paste"><pre>' | grep -B 999999999 "^</pre>" | sed -e "s/.*<pre>//" -e "s/^<\/pre>.*//" | base64 -d | gunzip | grep "^ii\s" | col2) else sudo apt install $(cat "$OBJECT" | grep "^ii\s" | col2) fi } usage() { cat <<EOF USAGE: $0 export [-|URL|FILENAME] $0 import -|URL|FILENAME EOF exit 0 } if [ -n "$1" ]; then ACTION="$1" shift else usage fi if [ -n "$1" ]; then OBJECT="$1" shift fi if [ "$ACTION" = "import" ]; then import_packages elif [ "$ACTION" = "export" ]; then [ -n "$OBJECT" ] || OBJECT="http://paste.ubuntu.com" export_packages else usage fi