XYZ File Manager
Current Path:
/usr/bin
usr
/
bin
/
📁
..
📁
X11
📄
[
(66.89 KB)
📄
ab
(58.42 KB)
📄
addpart
(30.31 KB)
📄
apt
(18.31 KB)
📄
apt-cache
(86.38 KB)
📄
apt-cdrom
(22.38 KB)
📄
apt-config
(26.31 KB)
📄
apt-get
(50.38 KB)
📄
apt-key
(27.32 KB)
📄
apt-mark
(58.38 KB)
📄
arch
(42.86 KB)
📄
awk
(154.66 KB)
📄
b2sum
(58.98 KB)
📄
base32
(46.89 KB)
📄
base64
(46.89 KB)
📄
basename
(42.83 KB)
📄
basenc
(54.89 KB)
📄
bash
(1.21 MB)
📄
bashbug
(6.7 KB)
📄
bdftopcf
(42.45 KB)
📄
bdftruncate
(10.22 KB)
📄
busctl
(90.5 KB)
📄
c_rehash
(6.68 KB)
📄
captoinfo
(90.34 KB)
📄
cat
(42.98 KB)
📄
certbot
(958 B)
📄
chage
(78.49 KB)
📄
chardet
(221 B)
📄
chardetect
(221 B)
📄
chattr
(14.24 KB)
📄
chcon
(67.11 KB)
📄
checkgid
(14.23 KB)
📄
chfn
(61.2 KB)
📄
chgrp
(67.05 KB)
📄
chmod
(62.98 KB)
📄
choom
(54.31 KB)
📄
chown
(71.05 KB)
📄
chrt
(66.31 KB)
📄
chsh
(51.64 KB)
📄
cksum
(139.05 KB)
📄
clear
(14.24 KB)
📄
clear_console
(14.15 KB)
📄
cmp
(50.95 KB)
📄
comm
(46.92 KB)
📄
corelist
(15.01 KB)
📄
cp
(147.61 KB)
📄
cpan
(8.16 KB)
📄
cpan5.36-x86_64-linux-gnu
(8.18 KB)
📄
csplit
(119.17 KB)
📄
ctstat
(26.59 KB)
📄
cut
(46.98 KB)
📄
dash
(122.7 KB)
📄
date
(119.05 KB)
📄
dbus-cleanup-sockets
(14.22 KB)
📄
dbus-daemon
(238.56 KB)
📄
dbus-monitor
(26.23 KB)
📄
dbus-run-session
(14.23 KB)
📄
dbus-send
(30.22 KB)
📄
dbus-update-activation-environment
(14.22 KB)
📄
dbus-uuidgen
(14.22 KB)
📄
dd
(87.15 KB)
📄
deb-systemd-helper
(23.79 KB)
📄
deb-systemd-invoke
(6.09 KB)
📄
debconf
(2.79 KB)
📄
debconf-apt-progress
(11.27 KB)
📄
debconf-communicate
(608 B)
📄
debconf-copydb
(1.68 KB)
📄
debconf-escape
(647 B)
📄
debconf-set-selections
(2.92 KB)
📄
debconf-show
(1.78 KB)
📄
delpart
(30.31 KB)
📄
df
(99.8 KB)
📄
dialog
(247.85 KB)
📄
diff
(151.58 KB)
📄
diff3
(67.14 KB)
📄
dir
(147.8 KB)
📄
dircolors
(50.92 KB)
📄
dirname
(38.83 KB)
📄
dmesg
(86.58 KB)
📄
dnsdomainname
(22.15 KB)
📄
domainname
(22.15 KB)
📄
dpkg
(310.64 KB)
📄
dpkg-deb
(166.52 KB)
📄
dpkg-divert
(154.55 KB)
📄
dpkg-maintscript-helper
(20.71 KB)
📄
dpkg-query
(158.58 KB)
📄
dpkg-realpath
(4.09 KB)
📄
dpkg-split
(126.48 KB)
📄
dpkg-statoverride
(62.33 KB)
📄
dpkg-trigger
(86.48 KB)
📄
du
(171.33 KB)
📄
dvipdf
(1007 B)
📄
echo
(42.83 KB)
📄
editor
(3.48 MB)
📄
egrep
(41 B)
📄
enc2xs
(40.96 KB)
📄
encguess
(3 KB)
📄
env
(47.4 KB)
📄
eps2eps
(639 B)
📄
ex
(3.48 MB)
📄
expand
(42.92 KB)
📄
expiry
(30.45 KB)
📄
expr
(115.05 KB)
📄
factor
(83.2 KB)
📄
faillog
(22.53 KB)
📄
fallocate
(34.31 KB)
📄
false
(34.83 KB)
📄
fcgistarter
(14.23 KB)
📄
fgrep
(41 B)
📄
fincore
(34.36 KB)
📄
find
(219.58 KB)
📄
findmnt
(83.59 KB)
📄
flock
(34.39 KB)
📄
fmt
(46.89 KB)
📄
fold
(42.89 KB)
📄
fonttosfnt
(34.41 KB)
📄
free
(26.3 KB)
📄
fuser
(39.83 KB)
📄
getconf
(26.5 KB)
📄
getent
(35.47 KB)
📄
getopt
(34.31 KB)
📄
ghostscript
(14.23 KB)
📄
gpasswd
(86.42 KB)
📄
gpgv
(463 KB)
📄
grep
(198.39 KB)
📄
groups
(42.89 KB)
📄
gs
(14.23 KB)
📄
gsbj
(350 B)
📄
gsdj
(352 B)
📄
gsdj500
(352 B)
📄
gslj
(353 B)
📄
gslp
(350 B)
📄
gsnd
(277 B)
📄
gunzip
(2.29 KB)
📄
gzexe
(6.3 KB)
📄
gzip
(95.84 KB)
📄
h2ph
(28.54 KB)
📄
h2xs
(59.51 KB)
📄
hardlink
(50.39 KB)
📄
head
(46.95 KB)
📄
helpztags
(2.46 KB)
📄
hostid
(38.83 KB)
📄
hostname
(22.15 KB)
📄
hostnamectl
(30.38 KB)
📄
htcacheclean
(34.24 KB)
📄
htdbm
(26.23 KB)
📄
htdigest
(14.23 KB)
📄
htpasswd
(26.23 KB)
📄
i386
(26.58 KB)
📄
iconv
(63.13 KB)
📄
id
(47.02 KB)
📄
infocmp
(62.31 KB)
📄
infotocap
(90.34 KB)
📄
install
(155.8 KB)
📄
instmodsh
(4.27 KB)
📄
ionice
(34.31 KB)
📄
ip
(674.82 KB)
📄
ipcmk
(34.38 KB)
📄
ipcrm
(34.31 KB)
📄
ipcs
(74.31 KB)
📄
ischroot
(14.32 KB)
📄
join
(54.98 KB)
📄
journalctl
(74.64 KB)
📄
json_pp
(4.88 KB)
📄
kernel-install
(12.75 KB)
📄
kill
(22.3 KB)
📄
killall
(31.95 KB)
📄
last
(50.31 KB)
📄
lastb
(50.31 KB)
📄
lastlog
(31.75 KB)
📄
lcf
(7.6 KB)
📄
ld.so
(205.96 KB)
📄
ldd
(5.28 KB)
📄
letsencrypt
(958 B)
📄
libnetcfg
(15.41 KB)
📄
link
(38.83 KB)
📄
linux32
(26.58 KB)
📄
linux64
(26.58 KB)
📄
ln
(71.12 KB)
📄
lnstat
(26.59 KB)
📄
locale
(46.16 KB)
📄
localectl
(26.38 KB)
📄
localedef
(291.91 KB)
📄
logger
(54.9 KB)
📄
login
(51.78 KB)
📄
loginctl
(58.48 KB)
📄
logname
(38.83 KB)
📄
logresolve
(14.24 KB)
📄
ls
(147.8 KB)
📄
lsattr
(14.24 KB)
📄
lsb_release
(2.59 KB)
📄
lsblk
(202.31 KB)
📄
lscpu
(126.31 KB)
📄
lsfd
(120.3 KB)
📄
lsipc
(98.31 KB)
📄
lsirq
(34.48 KB)
📄
lslocks
(70.7 KB)
📄
lslogins
(94.31 KB)
📄
lsmem
(66.31 KB)
📄
lsns
(82.31 KB)
📄
mawk
(154.66 KB)
📄
mcookie
(34.38 KB)
📄
md5sum
(50.95 KB)
📄
md5sum.textutils
(50.95 KB)
📄
mesg
(18.3 KB)
📄
mkdir
(95.27 KB)
📄
mkfifo
(67.17 KB)
📄
mkfontdir
(65 B)
📄
mkfontscale
(39.05 KB)
📄
mknod
(71.2 KB)
📄
mktemp
(42.92 KB)
📄
more
(58.31 KB)
📄
mount
(58.3 KB)
📄
mountpoint
(18.3 KB)
📄
mv
(139.62 KB)
📄
namei
(34.31 KB)
📄
nawk
(154.66 KB)
📄
netstat
(151.66 KB)
📄
networkctl
(106.38 KB)
📄
newgrp
(47.75 KB)
📄
nice
(42.86 KB)
📄
nisdomainname
(22.15 KB)
📄
nl
(111.11 KB)
📄
nohup
(42.89 KB)
📄
normalizer
(244 B)
📄
nproc
(42.89 KB)
📄
nsenter
(34.54 KB)
📄
nstat
(104.45 KB)
📄
numfmt
(67.02 KB)
📄
od
(79.02 KB)
📄
openssl
(953.26 KB)
📄
pager
(58.31 KB)
📄
paperconf
(14.34 KB)
📄
partx
(118.31 KB)
📄
passwd
(66.65 KB)
📄
paste
(42.89 KB)
📄
pathchk
(42.86 KB)
📄
pdb3
(62.4 KB)
📄
pdb3.11
(62.4 KB)
📄
pdf2dsc
(698 B)
📄
pdf2ps
(909 B)
📄
peekfd
(14.5 KB)
📄
perl
(3.63 MB)
📄
perl5.36-x86_64-linux-gnu
(14.41 KB)
📄
perl5.36.0
(3.63 MB)
📄
perlbug
(44.12 KB)
📄
perldoc
(125 B)
📄
perlivp
(10.61 KB)
📄
perlthanks
(44.12 KB)
📄
pf2afm
(498 B)
📄
pfbtopfa
(516 B)
📄
pgrep
(34.42 KB)
📄
phar
(14.88 KB)
📄
phar.phar
(14.88 KB)
📄
phar.phar8.2
(14.88 KB)
📄
phar8.2
(14.88 KB)
📄
phar8.2.phar
(14.88 KB)
📄
php
(5.4 MB)
📄
php8.2
(5.4 MB)
📄
piconv
(8.16 KB)
📄
pidof
(26.31 KB)
📄
pidwait
(34.42 KB)
📄
pinky
(47.05 KB)
📄
pkill
(34.42 KB)
📄
pl2pm
(4.43 KB)
📄
pldd
(22.69 KB)
📄
pmap
(34.34 KB)
📄
pod2html
(4.04 KB)
📄
pod2man
(14.68 KB)
📄
pod2text
(10.55 KB)
📄
pod2usage
(4.01 KB)
📄
podchecker
(3.57 KB)
📄
pphs
(404 B)
📄
pr
(79.11 KB)
📄
printafm
(395 B)
📄
printenv
(34.83 KB)
📄
printf
(62.92 KB)
📄
prlimit
(38.83 KB)
📄
prove
(13.34 KB)
📄
prtstat
(18.57 KB)
📄
ps
(142.93 KB)
📄
ps2ascii
(631 B)
📄
ps2epsi
(1.23 KB)
📄
ps2pdf
(272 B)
📄
ps2pdf12
(215 B)
📄
ps2pdf13
(215 B)
📄
ps2pdf14
(215 B)
📄
ps2pdfwr
(1.05 KB)
📄
ps2ps
(647 B)
📄
ps2ps2
(669 B)
📄
ps2txt
(631 B)
📄
pslog
(14.45 KB)
📄
pstree
(35.78 KB)
📄
pstree.x11
(35.78 KB)
📄
ptar
(3.48 KB)
📄
ptardiff
(2.58 KB)
📄
ptargrep
(4.29 KB)
📄
ptx
(135.23 KB)
📄
pwd
(42.92 KB)
📄
pwdx
(14.3 KB)
📄
py3clean
(7.63 KB)
📄
py3compile
(13 KB)
📄
py3versions
(12.52 KB)
📄
pydoc3
(79 B)
📄
pydoc3.11
(79 B)
📄
pygettext3
(23.67 KB)
📄
pygettext3.11
(23.67 KB)
📄
python3
(6.52 MB)
📄
python3.11
(6.52 MB)
📄
rbash
(1.21 MB)
📄
rdma
(180.6 KB)
📄
readlink
(50.89 KB)
📄
realpath
(50.92 KB)
📄
rename.ul
(22.3 KB)
📄
renice
(14.3 KB)
📄
reset
(30.24 KB)
📄
resizepart
(70.31 KB)
📄
rev
(14.3 KB)
📄
rgrep
(30 B)
📄
rm
(71.05 KB)
📄
rmdir
(54.92 KB)
📄
rotatelogs
(26.31 KB)
📄
routel
(1.62 KB)
📄
rtstat
(26.59 KB)
📄
run-parts
(26.91 KB)
📄
runcon
(42.95 KB)
📄
rview
(3.48 MB)
📄
rvim
(3.48 MB)
📄
savelog
(10.24 KB)
📄
scp
(266.63 KB)
📄
script
(70.3 KB)
📄
scriptlive
(54.3 KB)
📄
scriptreplay
(46.3 KB)
📄
sdiff
(55.08 KB)
📄
sed
(123.46 KB)
📄
select-editor
(2.39 KB)
📄
sensible-browser
(1.26 KB)
📄
sensible-editor
(1.24 KB)
📄
sensible-pager
(565 B)
📄
seq
(58.92 KB)
📄
setarch
(26.58 KB)
📄
setpriv
(78.31 KB)
📄
setsid
(14.3 KB)
📄
setterm
(46.31 KB)
📄
sftp
(282.59 KB)
📄
sg
(47.75 KB)
📄
sh
(122.7 KB)
📄
sha1sum
(54.95 KB)
📄
sha224sum
(58.95 KB)
📄
sha256sum
(58.95 KB)
📄
sha384sum
(62.95 KB)
📄
sha512sum
(62.95 KB)
📄
shasum
(9.75 KB)
📄
shred
(63.14 KB)
📄
shuf
(58.98 KB)
📄
skill
(30.33 KB)
📄
slabtop
(22.37 KB)
📄
sleep
(42.86 KB)
📄
slogin
(1.07 MB)
📄
snice
(30.33 KB)
📄
sort
(115.68 KB)
📄
splain
(18.99 KB)
📄
split
(59.55 KB)
📄
ss
(189.14 KB)
📄
ssh
(1.07 MB)
📄
ssh-add
(518.44 KB)
📄
ssh-agent
(474.38 KB)
📄
ssh-argv0
(1.42 KB)
📄
ssh-copy-id
(12.38 KB)
📄
ssh-keygen
(646.44 KB)
📄
ssh-keyscan
(622.47 KB)
📄
stat
(95.2 KB)
📄
stdbuf
(58.92 KB)
📄
streamzip
(7.75 KB)
📄
stty
(83.02 KB)
📄
su
(70.31 KB)
📄
sum
(50.96 KB)
📄
sync
(38.89 KB)
📄
systemctl
(1.29 MB)
📄
systemd
(90.38 KB)
📄
systemd-analyze
(182.61 KB)
📄
systemd-ask-password
(18.48 KB)
📄
systemd-cat
(18.38 KB)
📄
systemd-cgls
(22.48 KB)
📄
systemd-cgtop
(38.4 KB)
📄
systemd-creds
(42.61 KB)
📄
systemd-cryptenroll
(58.6 KB)
📄
systemd-delta
(26.38 KB)
📄
systemd-detect-virt
(18.37 KB)
📄
systemd-escape
(18.37 KB)
📄
systemd-firstboot
(50.59 KB)
📄
systemd-id128
(22.37 KB)
📄
systemd-inhibit
(22.39 KB)
📄
systemd-machine-id-setup
(18.48 KB)
📄
systemd-mount
(50.59 KB)
📄
systemd-notify
(18.38 KB)
📄
systemd-path
(18.37 KB)
📄
systemd-repart
(150.69 KB)
📄
systemd-run
(58.57 KB)
📄
systemd-socket-activate
(26.38 KB)
📄
systemd-stdio-bridge
(18.38 KB)
📄
systemd-sysext
(42.49 KB)
📄
systemd-sysusers
(62.68 KB)
📄
systemd-tmpfiles
(110.57 KB)
📄
systemd-tty-ask-password-agent
(34.38 KB)
📄
systemd-umount
(50.59 KB)
📄
tabs
(18.23 KB)
📄
tac
(111.05 KB)
📄
tail
(75.14 KB)
📄
tar
(519.52 KB)
📄
taskset
(62.31 KB)
📄
tee
(42.95 KB)
📄
tempfile
(14.18 KB)
📄
test
(58.89 KB)
📄
tic
(90.34 KB)
📄
timedatectl
(42.37 KB)
📄
timeout
(47.49 KB)
📄
tload
(18.32 KB)
📄
toe
(22.23 KB)
📄
top
(131.58 KB)
📄
touch
(107.05 KB)
📄
tput
(26.27 KB)
📄
tr
(54.89 KB)
📄
true
(34.83 KB)
📄
truncate
(42.89 KB)
📄
tset
(30.24 KB)
📄
tsort
(54.89 KB)
📄
tty
(34.86 KB)
📄
tzselect
(14.99 KB)
📄
ucf
(40.69 KB)
📄
ucfq
(18.91 KB)
📄
ucfr
(10.85 KB)
📄
uclampset
(62.31 KB)
📄
ucs2any
(18.32 KB)
📄
umount
(34.3 KB)
📄
uname
(42.86 KB)
📄
uncompress
(2.29 KB)
📄
unexpand
(42.92 KB)
📄
uniq
(46.95 KB)
📄
unlink
(38.83 KB)
📄
unshare
(82.54 KB)
📄
update-alternatives
(58.31 KB)
📄
update-mime-database
(59.27 KB)
📄
uptime
(14.3 KB)
📄
users
(38.89 KB)
📄
utmpdump
(30.3 KB)
📄
vdir
(147.8 KB)
📄
vi
(3.48 MB)
📄
view
(3.48 MB)
📄
vim
(3.48 MB)
📄
vim.basic
(3.48 MB)
📄
vimdiff
(3.48 MB)
📄
vimtutor
(2.1 KB)
📄
vmstat
(34.72 KB)
📄
w
(22.3 KB)
📄
wall
(38.3 KB)
📄
watch
(26.71 KB)
📄
wc
(51.05 KB)
📄
wdctl
(70.34 KB)
📄
wget
(527.36 KB)
📄
whereis
(30.77 KB)
📄
which
(946 B)
📄
which.debianutils
(946 B)
📄
who
(59.02 KB)
📄
whoami
(38.86 KB)
📄
x86_64
(26.58 KB)
📄
xargs
(70.45 KB)
📄
xdg-user-dir
(234 B)
📄
xdg-user-dirs-update
(26.16 KB)
📄
xsubpp
(5.05 KB)
📄
xxd
(18.21 KB)
📄
yes
(38.83 KB)
📄
ypdomainname
(22.15 KB)
📄
zcat
(1.94 KB)
📄
zcmp
(1.64 KB)
📄
zdiff
(6.31 KB)
📄
zdump
(22.52 KB)
📄
zegrep
(29 B)
📄
zfgrep
(29 B)
📄
zforce
(2.03 KB)
📄
zgrep
(7.91 KB)
📄
zipdetails
(68.55 KB)
📄
zless
(2.15 KB)
📄
zmore
(1.8 KB)
📄
znew
(4.47 KB)
Editing: ucfr
#!/bin/sh # -*- Mode: Sh -*- # ucfr --- # Author : Manoj Srivastava ( srivasta@glaurung.internal.golden-gryphon.com ) # Created On : Tue Apr 11 11:09:15 2006 # Created On Node : glaurung.internal.golden-gryphon.com # Last Modified By : Manoj Srivastava # Last Modified On : Tue Apr 11 13:50:58 2006 # Last Machine Used: glaurung.internal.golden-gryphon.com # Update Count : 43 # Status : Unknown, Use with caution! # HISTORY : # Description : # # Register a configuration file as belonging to a package # # arch-tag: 6e1d33fe-a930-41ce-8d0f-c87f87b19918 # # make sure we exit on error set -e # set the version and revision progname=$(basename "$0") pversion='Revision 3.00' ###################################################################### ######## ######### ######## Utility functions ######### ######## ######### ###################################################################### setq() { # Variable Value Doc_string if [ "x$2" = "x" ]; then echo >&2 "$progname: Unable to determine $3" exit 1; else if [ "x$VERBOSE" != "x" ]; then echo >&2 "$progname: $3 is $2"; fi eval "$1=\"\$2\""; fi } withecho () { echo "$@" >&2 "$@" } purge_from_registry () { if [ ! -e "$statedir/registry" ]; then echo >&2 "$progname: Internal error: $statedir/registry does not exist"; exit 6; fi if [ "$count" -eq 0 ]; then if [ "X$VERBOSE" != "X" ]; then echo >&2 "$progname: Association already purged. No changes."; fi exit 0; fi old_pkg=$(grep -E "[[:space:]]${real_conf_file_re}$" "$statedir/registry" | \ awk '{print $1;}' ); if [ "$pkg" != "$old_pkg" ]; then echo >&2 "ucfr: Association belongs to $old_pkg, not $pkg"; if [ "X$FORCE" = "X" ]; then echo >&2 "ucfr: Aborting"; exit 5; fi fi # OK, so we have something to purge. for i in $(/usr/bin/seq 6 -1 0); do if [ -e "${statedir}/registry.${i}" ]; then if [ "X$docmd" = "XYES" ]; then cp -f "${statedir}/registry.${i}" "${statedir}/registry.$(($i + 1))" else echo cp -f "${statedir}/registry.${i}" "${statedir}/registry.$(($i + 1))" fi fi done if [ "X$docmd" = "XYES" ]; then cp -f "$statedir/registry" "$statedir/registry.0" else echo cp -f "$statedir/registry" "$statedir/registry.0" fi if [ "X$docmd" = "XYES" ]; then set +e if [ "X$VERBOSE" != "X" ]; then echo "grep -Ev [[:space:]]${real_conf_file_re}$ $statedir/registry >\\" echo " $statedir/registry.tmp || true"; fi #echo "grep -Ev [[:space:]]${real_conf_file_re}$ $statedir/registry" grep -Ev "[[:space:]]${real_conf_file_re}$" "$statedir/registry" > \ "$statedir/registry.tmp" || true; if [ "X$docmd" = "XYES" ]; then mv -f "$statedir/registry.tmp" "$statedir/registry" else echo mv -f "$statedir/registry.tmp" "$statedir/registry" fi set -e fi } replace_in_registry () { if [ ! -e "$statedir/registry" ]; then echo >&2 "$progname: Internal error: $statedir/registry does not exist"; exit 6; fi if [ "$count" -eq 1 ]; then old_pkg=$(grep -E "[[:space:]]${real_conf_file_re}$" "$statedir/registry" | \ awk '{print $1;}' ); if [ "$pkg" != "$old_pkg" ]; then divert_package=$(dpkg-divert --listpackage "$conf_file") if [ -n "$divert_package" ]; then if [ "X$VERBOSE" != "X" ]; then echo >&2 "$progname: Package $pkg will not take away diverted ${conf_file} from package $divert_package"; fi exit 0; else if [ "X$FORCE" = "X" ]; then echo >&2 "$progname: Attempt from package $pkg to take ${real_conf_file} away from package $old_pkg"; echo >&2 "ucfr: Aborting."; exit 4; fi fi else if [ "X$VERBOSE" != "X" ]; then echo >&2 "$progname: Association already recorded. No changes."; fi exit 0; fi fi for i in $(/usr/bin/seq 6 -1 0); do if [ -e "${statedir}/registry.${i}" ]; then if [ "X$docmd" = "XYES" ]; then cp -f "${statedir}/registry.${i}" \ "${statedir}/registry.$(($i + 1))" else echo cp -f "${statedir}/registry.${i}" \ "${statedir}/registry.$(($i + 1))" fi fi done if [ "X$docmd" = "XYES" ]; then cp -f "$statedir/registry" "$statedir/registry.0" else echo cp -f "$statedir/registry" "$statedir/registry.0" fi if [ "X$docmd" = "XYES" ]; then set +e if [ "X$VERBOSE" != "X" ]; then echo "grep -Ev \"[[:space:]]${real_conf_file_re}$\" \"$statedir/registry\" \\" echo " $statedir/registry.tmp || true" echo "echo \"$pkg $real_conf_file\" >> \"$statedir/registry.tmp\"" echo "mv -f $statedir/registry.tmp $statedir/registry" fi grep -Ev "[[:space:]]${real_conf_file_re}$" "$statedir/registry" > \ "$statedir/registry.tmp" || true; echo "$pkg $real_conf_file" >> "$statedir/registry.tmp"; mv -f "$statedir/registry.tmp" "$statedir/registry" set -e else echo "grep -Ev \"[[:space:]]${real_conf_file_re}$\" \"$statedir/registry\" \\" echo " $statedir/registry.tmp || true" echo "echo \"$pkg $real_conf_file\" >> \"$statedir/registry.tmp\"" echo "mv -f $statedir/registry.tmp $statedir/registry" fi } usageversion () { cat >&2 <<END Debian GNU/Linux $progname $pversion. Copyright (C) 2002-2006 Manoj Srivastava. This is free software; see the GNU General Public Licence for copying conditions. There is NO warranty. Usage: $progname [options] package_name path_for_configuration_file Options: -h, --help print this message -f --force Force the association, even if another package used to own the configuration file. -d [n], --debug [n] Set the Debug level to N -n, --no-action Dry run. No action is actually taken. -v, --verbose Make the script verbose -p, --purge Remove any reference to the package/file association from the records --state-dir bar Set the state directory to bar instead of the default '/var/lib/ucf'. Used mostly for testing. END } ###################################################################### ######## ######### ######## Command line args ######### ######## ######### ###################################################################### # # Long term variables# # docmd='YES' action='withecho' action= DEBUG=0 VERBOSE='' statedir='/var/lib/ucf'; THREEWAY= # Note that we use `"$@"' to let each command-line parameter expand to a # separate word. The quotes around `$@' are essential! # We need TEMP as the `eval set --' would nuke the return value of getopt. TEMP=$(getopt -a -o hd::D::fnvp -n "$progname" \ --long help,debug::,DEBUG::,force,no-action,purge,verbose,state-dir: \ -- "$@") if [ $? != 0 ] ; then echo "Error handling options.Terminating..." >&2 ; exit 1 ; fi # Note the quotes around `$TEMP': they are essential! eval set -- "$TEMP" while true ; do case "$1" in -h|--help) usageversion; exit 0 ;; -n|--no-action) action='echo'; docmd='NO'; shift ;; -v|--verbose) VERBOSE=1; shift ;; -f|--force) FORCE=1; shift ;; --state-dir) opt_state_dir="$2"; shift 2 ;; -D|-d|--debug|--DEBUG) # d has an optional argument. As we are in quoted mode, # an empty parameter will be generated if its optional # argument is not found. case "$2" in "") setq DEBUG 1 "The Debug value"; shift 2 ;; *) setq DEBUG "$2" "The Debug value"; shift 2 ;; esac ;; -p|--purge) PURGE=YES; shift ;; --) shift ; break ;; *) echo >&2 "$progname: Internal error!" ; exit 1 ;; esac done # Need to run as root, or else the if test "$(id -u)" != 0; then if [ "$docmd" = "YES" ]; then echo "$progname: Need to be run as root." >&2 echo "$progname: Setting up no action mode." >&2 action='echo'; docmd='NO'; fi fi if [ $# != 2 ]; then echo >&2 "$progname: *** ERROR: Need exactly two arguments, got $#"; echo >&2 "" usageversion; exit 3 ; fi # We have here a configuration file, which can be a symlink, and may # contain characters that are unsafe in regular expressions setq pkg "$1" "The Package name"; setq conf_file "$2" "The Configuration file"; setq real_conf_file "$(readlink -q -m $conf_file)" "The (real) Configuration file"; pkg_re="$(echo $pkg | sed -e 's,+,\\+,')" conf_file_re="$(echo $conf_file | sed -e 's,+,\\+,')" real_conf_file_re="$(echo $real_conf_file | sed -e 's,+,\\+,')" case $conf_file_re in /*) : echo fine ;; *) echo >&2 "$progname: Need a fully qualified path for the file \"$conf_file\"" # Don't exit with an error for etch' exit 0; esac # Load site defaults and over rides. if [ -f /etc/ucf.conf ]; then . /etc/ucf.conf fi # Command line, env variable, config file, or default if [ ! "x$opt_state_dir" = "x" ]; then setq statedir "$opt_state_dir" "The State directory" elif [ ! "x$UCF_STATE_DIR" = "x" ]; then setq statedir "$UCF_STATE_DIR" "The State directory" elif [ ! "x$conf_state_dir" = "x" ]; then setq statedir "$conf_state_dir" "The State directory" else setq statedir '/var/lib/ucf' "The State directory" fi # VERBOSE of 0 is supposed to be the same as not setting VERBOSE if [ "X$VERBOSE" = "X0" ]; then VERBOSE='' fi # if [ -e "$statedir/registry" -a ! -w "$statedir/registry" ]; then echo >&2 "$progname: do not have write privilege to the registry data" if [ "X$docmd" = "XYES" ]; then exit 1; fi fi # test and see if this file exists in the database if [ ! -d "$statedir" ]; then $action mkdir -p "$statedir" fi if [ ! -f "$statedir/registry" ]; then $action touch "$statedir/registry" fi if [ "X$VERBOSE" != "X" ]; then echo >&2 "$progname: The registry exists" fi # sanity check count=$(grep -E --count "[[:space:]]${real_conf_file_re}$" "$statedir/registry") || true if [ "$count" -ge 2 ]; then echo >&2 "$progname: Corrupt registry: Duplicate entries for ${conf_file}"; grep -E "[[:space:]]${real_conf_file_re}$" "$statedir/registry"; exit "$count"; fi if [ "X$PURGE" != "X" ]; then $action purge_from_registry else $action replace_in_registry fi exit 0;
Upload File
Create Folder