/
usr
/
sbin
/
/usr/sbin
mkdir
upload
Name
Size
Mode
Actions
a2disconf
16276
0755
edit
dl
rm
a2dismod
16276
0755
edit
dl
rm
a2dissite
16276
0755
edit
dl
rm
a2enconf
16276
0755
edit
dl
rm
a2enmod
16276
0755
edit
dl
rm
a2ensite
16276
0755
edit
dl
rm
a2query
9870
0755
edit
dl
rm
aa-remove-unknown
3068
0755
edit
dl
rm
aa-status
64120
0755
edit
dl
rm
aa-teardown
137
0755
edit
dl
rm
accessdb
14904
0755
edit
dl
rm
add-shell
1051
0755
edit
dl
rm
addgnupghome
3075
0755
edit
dl
rm
addgroup
38247
0755
edit
dl
rm
adduser
38247
0755
edit
dl
rm
agetty
56896
0755
edit
dl
rm
apache2
758736
0755
edit
dl
rm
apache2ctl
7229
0755
edit
dl
rm
apachectl
7229
0755
edit
dl
rm
apparmor_parser
1548064
0755
edit
dl
rm
apparmor_status
64120
0755
edit
dl
rm
applygnupgdefaults
2217
0755
edit
dl
rm
arp
63088
0755
edit
dl
rm
arpd
26960
0755
edit
dl
rm
arptables
224296
0755
edit
dl
rm
arptables-nft
224296
0755
edit
dl
rm
arptables-nft-restore
224296
0755
edit
dl
rm
arptables-nft-save
224296
0755
edit
dl
rm
arptables-restore
224296
0755
edit
dl
rm
arptables-save
224296
0755
edit
dl
rm
badblocks
35144
0755
edit
dl
rm
bcache-super-show
14648
0755
edit
dl
rm
biosdecode
23760
0755
edit
dl
rm
blkdeactivate
16351
0755
edit
dl
rm
blkdiscard
22912
0755
edit
dl
rm
blkid
51624
0755
edit
dl
rm
blkzone
35200
0755
edit
dl
rm
blockdev
31104
0755
edit
dl
rm
bridge
94712
0755
edit
dl
rm
cache_check
1389608
0755
edit
dl
rm
cache_dump
1389608
0755
edit
dl
rm
cache_metadata_size
1389608
0755
edit
dl
rm
cache_repair
1389608
0755
edit
dl
rm
cache_restore
1389608
0755
edit
dl
rm
cache_writeback
1389608
0755
edit
dl
rm
capsh
31032
0755
edit
dl
rm
cfdisk
97008
0755
edit
dl
rm
cgdisk
154096
0755
edit
dl
rm
chcpu
31104
0755
edit
dl
rm
check_forensic
952
0755
edit
dl
rm
chgpasswd
59528
0755
edit
dl
rm
chmem
35200
0755
edit
dl
rm
chpasswd
55464
0755
edit
dl
rm
chroot
39432
0755
edit
dl
rm
cpgr
49448
0755
edit
dl
rm
cppw
49448
0755
edit
dl
rm
cron
51792
0755
edit
dl
rm
cryptdisks_start
1544
0755
edit
dl
rm
cryptdisks_stop
844
0755
edit
dl
rm
cryptsetup
173616
0755
edit
dl
rm
cryptsetup-reencrypt
92544
0755
edit
dl
rm
cryptsetup-ssh
24096
0755
edit
dl
rm
ctrlaltdel
14720
0755
edit
dl
rm
dbconfig-generate-include
12656
0755
edit
dl
rm
dbconfig-load-include
5704
0755
edit
dl
rm
dcb
82448
0755
edit
dl
rm
debugfs
235320
0755
edit
dl
rm
delgroup
16495
0755
edit
dl
rm
deluser
16495
0755
edit
dl
rm
depmod
170352
0755
edit
dl
rm
devlink
146288
0755
edit
dl
rm
dhclient
453280
0755
edit
dl
rm
dhclient-script
16304
0755
edit
dl
rm
dmeventd
51592
0755
edit
dl
rm
dmidecode
125936
0755
edit
dl
rm
dmsetup
175128
0755
edit
dl
rm
dmstats
175128
0755
edit
dl
rm
dosfsck
84360
0755
edit
dl
rm
dosfslabel
39304
0755
edit
dl
rm
dpkg-preconfigure
3663
0755
edit
dl
rm
dpkg-reconfigure
4485
0755
edit
dl
rm
dumpe2fs
31040
0755
edit
dl
rm
e2freefrag
14648
0755
edit
dl
rm
e2fsck
360280
0755
edit
dl
rm
e2image
43328
0755
edit
dl
rm
e2label
105016
0755
edit
dl
rm
e2mmpstatus
31040
0755
edit
dl
rm
e2scrub
7296
0755
edit
dl
rm
e2scrub_all
5395
0755
edit
dl
rm
e2undo
22840
0755
edit
dl
rm
e4crypt
31104
0755
edit
dl
rm
e4defrag
31032
0755
edit
dl
rm
ebtables
224296
0755
edit
dl
rm
ebtables-nft
224296
0755
edit
dl
rm
ebtables-nft-restore
224296
0755
edit
dl
rm
ebtables-nft-save
224296
0755
edit
dl
rm
ebtables-restore
224296
0755
edit
dl
rm
ebtables-save
224296
0755
edit
dl
rm
era_check
1389608
0755
edit
dl
rm
era_dump
1389608
0755
edit
dl
rm
era_invalidate
1389608
0755
edit
dl
rm
era_restore
1389608
0755
edit
dl
rm
escapesrc
22992
0755
edit
dl
rm
ethtool
564712
0755
edit
dl
rm
faillock
14488
0755
edit
dl
rm
fatlabel
39304
0755
edit
dl
rm
fdisk
113072
0755
edit
dl
rm
filefrag
18760
0755
edit
dl
rm
findfs
14720
0755
edit
dl
rm
fixparts
59880
0755
edit
dl
rm
fsadm
24519
0755
edit
dl
rm
fsck
43440
0755
edit
dl
rm
fsck.btrfs
1185
0755
edit
dl
rm
fsck.cramfs
31168
0755
edit
dl
rm
fsck.ext2
360280
0755
edit
dl
rm
fsck.ext3
360280
0755
edit
dl
rm
fsck.ext4
360280
0755
edit
dl
rm
fsck.fat
84360
0755
edit
dl
rm
fsck.minix
55712
0755
edit
dl
rm
fsck.msdos
84360
0755
edit
dl
rm
fsck.vfat
84360
0755
edit
dl
rm
fsck.xfs
1940
0755
edit
dl
rm
fsfreeze
14720
0755
edit
dl
rm
fstab-decode
18744
0755
edit
dl
rm
fstrim
43392
0755
edit
dl
rm
gdisk
178672
0755
edit
dl
rm
genccode
15088
0755
edit
dl
rm
gencmn
15088
0755
edit
dl
rm
genl
92608
0755
edit
dl
rm
gennorm2
64408
0755
edit
dl
rm
gensprep
27448
0755
edit
dl
rm
getcap
14648
0755
edit
dl
rm
getpcaps
14648
0755
edit
dl
rm
getty
56896
0755
edit
dl
rm
groupadd
68520
0755
edit
dl
rm
groupdel
64232
0755
edit
dl
rm
groupmems
55488
0755
edit
dl
rm
groupmod
68424
0755
edit
dl
rm
grpck
59528
0755
edit
dl
rm
grpconv
51208
0755
edit
dl
rm
grpunconv
51208
0755
edit
dl
rm
grub-bios-setup
964016
0755
edit
dl
rm
grub-install
1204128
0755
edit
dl
rm
grub-macbless
951408
0755
edit
dl
rm
grub-mkconfig
8805
0755
edit
dl
rm
grub-mkdevicemap
220880
0755
edit
dl
rm
grub-probe
963952
0755
edit
dl
rm
grub-reboot
4841
0755
edit
dl
rm
grub-set-default
3556
0755
edit
dl
rm
halt
1119856
0755
edit
dl
rm
hdparm
142776
0755
edit
dl
rm
httxt2dbm
14648
0755
edit
dl
rm
hwclock
51712
0755
edit
dl
rm
iconvconfig
31128
0755
edit
dl
rm
icupkg
23656
0755
edit
dl
rm
ifconfig
79024
0755
edit
dl
rm
init
1849992
0755
edit
dl
rm
insmod
170352
0755
edit
dl
rm
installkernel
2659
0755
edit
dl
rm
integritysetup
55368
0755
edit
dl
rm
invoke-rc.d
16507
0755
edit
dl
rm
ip
718896
0755
edit
dl
rm
ip6tables
224296
0755
edit
dl
rm
ip6tables-apply
7057
0755
edit
dl
rm
ip6tables-legacy
99272
0755
edit
dl
rm
ip6tables-legacy-restore
99272
0755
edit
dl
rm
ip6tables-legacy-save
99272
0755
edit
dl
rm
ip6tables-nft
224296
0755
edit
dl
rm
ip6tables-nft-restore
224296
0755
edit
dl
rm
ip6tables-nft-save
224296
0755
edit
dl
rm
ip6tables-restore
224296
0755
edit
dl
rm
ip6tables-restore-translate
224296
0755
edit
dl
rm
ip6tables-save
224296
0755
edit
dl
rm
ip6tables-translate
224296
0755
edit
dl
rm
ipmaddr
18744
0755
edit
dl
rm
iptables
224296
0755
edit
dl
rm
iptables-apply
7057
0755
edit
dl
rm
iptables-legacy
99272
0755
edit
dl
rm
iptables-legacy-restore
99272
0755
edit
dl
rm
iptables-legacy-save
99272
0755
edit
dl
rm
iptables-nft
224296
0755
edit
dl
rm
iptables-nft-restore
224296
0755
edit
dl
rm
iptables-nft-save
224296
0755
edit
dl
rm
iptables-restore
224296
0755
edit
dl
rm
iptables-restore-translate
224296
0755
edit
dl
rm
iptables-save
224296
0755
edit
dl
rm
iptables-translate
224296
0755
edit
dl
rm
iptunnel
18744
0755
edit
dl
rm
irqbalance
68464
0755
edit
dl
rm
irqbalance-ui
35208
0755
edit
dl
rm
iscsi-iname
14648
0755
edit
dl
rm
iscsiadm
408024
0755
edit
dl
rm
iscsid
305720
0755
edit
dl
rm
iscsistart
285248
0755
edit
dl
rm
iscsi_discovery
5293
0755
edit
dl
rm
isosize
14720
0755
edit
dl
rm
iucode-tool
59736
0755
edit
dl
rm
iucode_tool
59736
0755
edit
dl
rm
kbdrate
18600
0755
edit
dl
rm
killall5
31112
0755
edit
dl
rm
kpartx
47272
0755
edit
dl
rm
ldattach
27008
0755
edit
dl
rm
ldconfig
387
0755
edit
dl
rm
ldconfig.real
1213960
0755
edit
dl
rm
locale-gen
4398
0755
edit
dl
rm
logrotate
104696
0755
edit
dl
rm
logsave
14496
0755
edit
dl
rm
losetup
72208
0755
edit
dl
rm
lsmod
170352
0755
edit
dl
rm
luksformat
3401
0755
edit
dl
rm
lvchange
3027544
0755
edit
dl
rm
lvconvert
3027544
0755
edit
dl
rm
lvcreate
3027544
0755
edit
dl
rm
lvdisplay
3027544
0755
edit
dl
rm
lvextend
3027544
0755
edit
dl
rm
lvm
3027544
0755
edit
dl
rm
lvmconfig
3027544
0755
edit
dl
rm
lvmdiskscan
3027544
0755
edit
dl
rm
lvmdump
10312
0755
edit
dl
rm
lvmpolld
241864
0755
edit
dl
rm
lvmsadc
3027544
0755
edit
dl
rm
lvmsar
3027544
0755
edit
dl
rm
lvreduce
3027544
0755
edit
dl
rm
lvremove
3027544
0755
edit
dl
rm
lvrename
3027544
0755
edit
dl
rm
lvresize
3027544
0755
edit
dl
rm
lvs
3027544
0755
edit
dl
rm
lvscan
3027544
0755
edit
dl
rm
make-bcache
22912
0755
edit
dl
rm
make-ssl-cert
6812
0755
edit
dl
rm
mdadm
615744
0755
edit
dl
rm
mdmon
264640
0755
edit
dl
rm
mii-tool
27376
0755
edit
dl
rm
mkdosfs
52048
0755
edit
dl
rm
mke2fs
133752
0755
edit
dl
rm
mkfs
14720
0755
edit
dl
rm
mkfs.bfs
22912
0755
edit
dl
rm
mkfs.btrfs
482560
0755
edit
dl
rm
mkfs.cramfs
35144
0755
edit
dl
rm
mkfs.ext2
133752
0755
edit
dl
rm
mkfs.ext3
133752
0755
edit
dl
rm
mkfs.ext4
133752
0755
edit
dl
rm
mkfs.fat
52048
0755
edit
dl
rm
mkfs.minix
43408
0755
edit
dl
rm
mkfs.msdos
52048
0755
edit
dl
rm
mkfs.ntfs
72072
0755
edit
dl
rm
mkfs.vfat
52048
0755
edit
dl
rm
mkfs.xfs
391960
0755
edit
dl
rm
mkhomedir_helper
22704
0755
edit
dl
rm
mkinitramfs
12453
0755
edit
dl
rm
mklost+found
14648
0755
edit
dl
rm
mkntfs
72072
0755
edit
dl
rm
mkswap
47496
0755
edit
dl
rm
ModemManager
2194240
0755
edit
dl
rm
modinfo
170352
0755
edit
dl
rm
modprobe
170352
0755
edit
dl
rm
mount.fuse
18736
0755
edit
dl
rm
mount.fuse3
18736
0755
edit
dl
rm
mount.lowntfs-3g
117736
0755
edit
dl
rm
mount.ntfs
162824
0755
edit
dl
rm
mount.ntfs-3g
162824
0755
edit
dl
rm
mpathpersist
31800
0755
edit
dl
rm
multipath
34968
0755
edit
dl
rm
multipathd
137480
0755
edit
dl
rm
mysqld
55604728
0755
edit
dl
rm
nameif
14824
0755
edit
dl
rm
needrestart
39658
0755
edit
dl
rm
netplan
798
0755
edit
dl
rm
netwatch
337664
0755
edit
dl
rm
newusers
76520
0755
edit
dl
rm
nfnl_osf
18736
0755
edit
dl
rm
nft
26856
0755
edit
dl
rm
nginx
1240552
0755
edit
dl
rm
nologin
14640
0755
edit
dl
rm
ntfsclone
51592
0755
edit
dl
rm
ntfscp
35200
0755
edit
dl
rm
ntfslabel
22912
0755
edit
dl
rm
ntfsresize
63888
0755
edit
dl
rm
ntfsundelete
51592
0755
edit
dl
rm
on_ac_power
3788
0755
edit
dl
rm
overlayroot-chroot
2510
0755
edit
dl
rm
ownership
14792
0755
edit
dl
rm
pam-auth-update
20992
0755
edit
dl
rm
pam_extrausers_chkpwd
22680
2755
edit
dl
rm
pam_extrausers_update
30872
0755
edit
dl
rm
pam_getenv
2890
0755
edit
dl
rm
pam_timestamp_check
14488
0755
edit
dl
rm
paperconfig
4170
0755
edit
dl
rm
parted
88472
0755
edit
dl
rm
partprobe
14720
0755
edit
dl
rm
pdata_tools
1389608
0755
edit
dl
rm
php-fpm8.1
5553448
0755
edit
dl
rm
php-fpm8.3
5780304
0755
edit
dl
rm
php-fpm8.5
10280440
0755
edit
dl
rm
phpdismod
7278
0755
edit
dl
rm
phpenmod
7278
0755
edit
dl
rm
phpquery
6389
0755
edit
dl
rm
pivot_root
14720
0755
edit
dl
rm
plipconfig
14648
0755
edit
dl
rm
plymouthd
154168
0755
edit
dl
rm
postalias
22832
0755
edit
dl
rm
postcat
22904
0755
edit
dl
rm
postconf
188208
0755
edit
dl
rm
postdrop
22960
2555
edit
dl
rm
postfix
18816
0755
edit
dl
rm
postfix-add-filter
4954
0755
edit
dl
rm
postfix-add-policy
3860
0755
edit
dl
rm
postfix-collate
2942
0755
edit
dl
rm
postkick
14640
0755
edit
dl
rm
postlock
14640
0755
edit
dl
rm
postlog
14800
0755
edit
dl
rm
postmap
22832
0755
edit
dl
rm
postmulti
31424
0755
edit
dl
rm
postqueue
22912
2555
edit
dl
rm
postsuper
31328
0755
edit
dl
rm
posttls-finger
43400
0755
edit
dl
rm
poweroff
1119856
0755
edit
dl
rm
pvchange
3027544
0755
edit
dl
rm
pvck
3027544
0755
edit
dl
rm
pvcreate
3027544
0755
edit
dl
rm
pvdisplay
3027544
0755
edit
dl
rm
pvmove
3027544
0755
edit
dl
rm
pvremove
3027544
0755
edit
dl
rm
pvresize
3027544
0755
edit
dl
rm
pvs
3027544
0755
edit
dl
rm
pvscan
3027544
0755
edit
dl
rm
pwck
51336
0755
edit
dl
rm
pwconv
47112
0755
edit
dl
rm
pwunconv
43016
0755
edit
dl
rm
qmqp-sink
18736
0755
edit
dl
rm
qmqp-source
22848
0755
edit
dl
rm
qshape
12849
0755
edit
dl
rm
rarp
33104
0755
edit
dl
rm
readprofile
22944
0755
edit
dl
rm
reboot
1119856
0755
edit
dl
rm
remove-shell
1099
0755
edit
dl
rm
resize2fs
67896
0755
edit
dl
rm
rmail
18736
0755
edit
dl
rm
rmmod
170352
0755
edit
dl
rm
rmt
59976
0755
edit
dl
rm
rmt-tar
59976
0755
edit
dl
rm
route
65808
0755
edit
dl
rm
rsyslogd
785600
0755
edit
dl
rm
rtacct
28992
0755
edit
dl
rm
rtcwake
35200
0755
edit
dl
rm
rtmon
92560
0755
edit
dl
rm
runlevel
1119856
0755
edit
dl
rm
runuser
55680
0755
edit
dl
rm
sendmail
31184
0755
edit
dl
rm
service
9097
0755
edit
dl
rm
setcap
14648
0755
edit
dl
rm
setvesablank
14568
0755
edit
dl
rm
setvtrgb
14632
0755
edit
dl
rm
sfdisk
104832
0755
edit
dl
rm
sgdisk
166384
0755
edit
dl
rm
shadowconfig
885
0755
edit
dl
rm
shutdown
1119856
0755
edit
dl
rm
slattach
36944
0755
edit
dl
rm
smtp-sink
36112
0755
edit
dl
rm
smtp-source
31048
0755
edit
dl
rm
split-logfile
2415
0755
edit
dl
rm
sshd
921288
0755
edit
dl
rm
start-stop-daemon
48488
0755
edit
dl
rm
statnetd
35032
0755
edit
dl
rm
sudo_logsrvd
204904
0755
edit
dl
rm
sudo_sendlog
109912
0755
edit
dl
rm
sulogin
43392
0755
edit
dl
rm
swaplabel
18816
0755
edit
dl
rm
swapoff
22912
0755
edit
dl
rm
swapon
43392
0755
edit
dl
rm
switch_root
22912
0755
edit
dl
rm
sysctl
30960
0755
edit
dl
rm
tarcat
936
0755
edit
dl
rm
tc
628816
0755
edit
dl
rm
tcpblast
35456
0755
edit
dl
rm
telinit
1119856
0755
edit
dl
rm
thermald
567912
0755
edit
dl
rm
thin_check
1389608
0755
edit
dl
rm
thin_delta
1389608
0755
edit
dl
rm
thin_dump
1389608
0755
edit
dl
rm
thin_ls
1389608
0755
edit
dl
rm
thin_metadata_size
1389608
0755
edit
dl
rm
thin_repair
1389608
0755
edit
dl
rm
thin_restore
1389608
0755
edit
dl
rm
thin_rmap
1389608
0755
edit
dl
rm
thin_trim
1389608
0755
edit
dl
rm
tipc
92608
0755
edit
dl
rm
trafshow
130592
0755
edit
dl
rm
tune2fs
105016
0755
edit
dl
rm
tzconfig
106
0755
edit
dl
rm
udpblast
35456
0755
edit
dl
rm
ufw
4938
0755
edit
dl
rm
umount.udisks2
14640
0755
edit
dl
rm
unix_chkpwd
26776
2755
edit
dl
rm
unix_update
30872
0755
edit
dl
rm
update-ca-certificates
5418
0755
edit
dl
rm
update-grub
64
0755
edit
dl
rm
update-grub-gfxpayload
301
0755
edit
dl
rm
update-grub2
64
0755
edit
dl
rm
update-gsfontmap
470
0755
edit
dl
rm
update-info-dir
1700
0755
edit
dl
rm
update-initramfs
6906
0755
edit
dl
rm
update-locale
3063
0755
edit
dl
rm
update-mime
9613
0755
edit
dl
rm
update-passwd
35392
0755
edit
dl
rm
update-pciids
1753
0755
edit
dl
rm
update-rc.d
17324
0755
edit
dl
rm
update-secureboot-policy
7605
0755
edit
dl
rm
update-shells
3806
0755
edit
dl
rm
upgrade-from-grub-legacy
1596
0755
edit
dl
rm
usbmuxd
88680
0755
edit
dl
rm
usb_modeswitch
61096
0755
edit
dl
rm
usb_modeswitch_dispatcher
27418
0755
edit
dl
rm
useradd
130720
0755
edit
dl
rm
userdel
88936
0755
edit
dl
rm
usermod
126424
0755
edit
dl
rm
uuidd
31592
0755
edit
dl
rm
validlocale
1773
0755
edit
dl
rm
vcstime
14488
0755
edit
dl
rm
vdpa
31296
0755
edit
dl
rm
veritysetup
44808
0755
edit
dl
rm
vgcfgbackup
3027544
0755
edit
dl
rm
vgcfgrestore
3027544
0755
edit
dl
rm
vgchange
3027544
0755
edit
dl
rm
vgck
3027544
0755
edit
dl
rm
vgconvert
3027544
0755
edit
dl
rm
vgcreate
3027544
0755
edit
dl
rm
vgdisplay
3027544
0755
edit
dl
rm
vgexport
3027544
0755
edit
dl
rm
vgextend
3027544
0755
edit
dl
rm
vgimport
3027544
0755
edit
dl
rm
vgimportclone
3027544
0755
edit
dl
rm
vgmerge
3027544
0755
edit
dl
rm
vgmknodes
3027544
0755
edit
dl
rm
vgreduce
3027544
0755
edit
dl
rm
vgremove
3027544
0755
edit
dl
rm
vgrename
3027544
0755
edit
dl
rm
vgs
3027544
0755
edit
dl
rm
vgscan
3027544
0755
edit
dl
rm
vgsplit
3027544
0755
edit
dl
rm
vigr
57888
0755
edit
dl
rm
vipw
57888
0755
edit
dl
rm
visudo
225064
0755
edit
dl
rm
vpddecode
14928
0755
edit
dl
rm
wipefs
39296
0755
edit
dl
rm
xfs_admin
1407
0755
edit
dl
rm
xfs_bmap
695
0755
edit
dl
rm
xfs_copy
84464
0755
edit
dl
rm
xfs_db
668096
0755
edit
dl
rm
xfs_estimate
14504
0755
edit
dl
rm
xfs_freeze
800
0755
edit
dl
rm
xfs_fsr
43192
0755
edit
dl
rm
xfs_growfs
39200
0755
edit
dl
rm
xfs_info
1294
0755
edit
dl
rm
xfs_io
204344
0755
edit
dl
rm
xfs_logprint
80208
0755
edit
dl
rm
xfs_mdrestore
26800
0755
edit
dl
rm
xfs_metadump
782
0755
edit
dl
rm
xfs_mkfile
1040
0755
edit
dl
rm
xfs_ncheck
685
0755
edit
dl
rm
xfs_quota
92328
0755
edit
dl
rm
xfs_repair
613768
0755
edit
dl
rm
xfs_rtcp
18584
0755
edit
dl
rm
xfs_scrub
108816
0755
edit
dl
rm
xfs_scrub_all
6006
0755
edit
dl
rm
xfs_spaceman
43320
0755
edit
dl
rm
xtables-legacy-multi
99272
0755
edit
dl
rm
xtables-monitor
224296
0755
edit
dl
rm
xtables-nft-multi
224296
0755
edit
dl
rm
zerofree
14488
0755
edit
dl
rm
zic
63816
0755
edit
dl
rm
zramctl
55824
0755
edit
dl
rm
Edit:
/usr/sbin/dbconfig-generate-include
(12656B)
#!/bin/sh # set some defaults format="sh" dbuser_varname="dbuser" dbpass_varname="dbpass" dbname_varname="dbname" dbserver_varname="dbserver" dbport_varname="dbport" dbtype_varname="dbtype" basepath_varname="basepath" # the version will always be < the package version VERSION="2.0" version(){ prog=$(basename $0) cat << EOF $prog v$VERSION copyright (c) 2005 sean finney <seanius@debian.org> EOF } usage(){ version cat << EOF usage: $prog [-hv] [-f format] [-a] [-d[varname]] [-u[varname]] [-p[varname]] [-s[varname]] [-P[varname]] [-t[varname]] [-C[comment]] [-O owner[:group]] [-m mode] [-U] infile [outfile] infile use the given dbconfig-common config file as input outfile use the given file as input (default: stdout) -f|--format use the given output format (default: sh) -o|--options provide output-format-specific options -a|--all include all information in output (default) -b|--basepath include the basepath in the output -d|--dbname include the dbname in the output -p|--dbpass include the dbpass in the output -s|--dbserver include the dbserver in the output -P|--dbport include the dbport in the output -u|--dbuser include the dbuser in the output -t|--dbtype include the dbtype in the output -C|--comment comment out unset variables -O|--owner set the owner:group of the output file -m|--mode set the permissions on the output file -U|--ucf register the outputfile with ucf -h|--help display this helpful message -v|--version output the version and exit format is one of a list of include-file style formats for various programming languages. the current list includes: sh - /bin/sh style include file perl - perl parseable include file php - php parseable include file template - perform pattern substitution on a pre-existing template cpp - c-style header file, using #define'd constants EOF } check_permissions(){ local line if dpkg-statoverride --list "$outputfile" >/dev/null; then line=$(dpkg-statoverride --list "$outputfile") owner=$(echo $line | cut -d' ' -f1,2 | tr ' ' ':') perms=$(echo $line | cut -d' ' -f3) fi } # Protect strings for use in the right hand side of a sed "s" command # # Without protection, double backslashes are interpreted as one # protected backslash, therefore "\\" -> "\\\\" # Without protection, an & "refers to that portion of the pattern # space which matched", therefore "&" -> "\\&" # The / is used as the seperator, so it needs escaping too, # therefore "/" -> "\\/" sed_rhs_escape(){ sed -e 's/\\/\\&/g' -e 's/&/\\&/g' -e 's,/,\\&,g' << EOF $1 EOF } # Protect strings for use in shell files where the variable is # quoted in single quotes sh_sq_escape(){ sed -e "s,','\\\\'',g" << EOF $1 EOF } # Protect strings for use in php files where the variable is # quoted in single quotes php_sq_escape(){ sed -e 's/\\/\\&/g' -e "s,',' . \"'\" . ',g" << EOF $1 EOF } # Protect strings for use in perl files where the variable is # quoted in single quotes perl_sq_escape(){ php_sq_escape "$1" } TEMP=$(getopt -o af:hb::d::m:o:p::u::s::t::C::O:P::Uv --long help,dbuser::,dbname::,dbpass::,dbport::,dbserver::,dbtype::,basepath::,output:,format:,options:,comment::,owner:,mode:,ucf,version -n $0 -- "$@") if [ $? != 0 ] ; then usage >&2 ; exit 1 ; fi eval set -- "$TEMP" while true; do case "$1" in -a|--all) use_all="yes" shift ;; -b|--basepath) use_basepath="yes" if [ ! -z "$2" ]; then basepath_varname="$2" fi shift 2 ;; -d|--dbname) use_dbname="yes" if [ ! -z "$2" ]; then dbname_varname="$2" fi shift 2 ;; -u|--dbuser) use_dbuser="yes" if [ ! -z "$2" ]; then dbuser_varname="$2" fi shift 2 ;; -p|--dbpass) use_dbpass="yes" if [ ! -z "$2" ]; then dbpass_varname="$2" fi shift 2 ;; -s|--dbserver) use_dbserver="yes" if [ ! -z "$2" ]; then dbserver_varname="$2" fi shift 2 ;; -P|--dbport) use_dbport="yes" if [ ! -z "$2" ]; then dbport_varname="$2" fi shift 2 ;; -t|--dbtype) use_dbtype="yes" if [ ! -z "$2" ]; then dbtype_varname="$2" fi shift 2 ;; -f|--format) format="$2" shift 2 ;; -C|--comment) use_comment="yes" if [ ! -z "$2" ]; then comment_string="$2" fi shift 2 ;; -O|--owner) owner="$2" shift 2 ;; -m|--mode) perms="$2" shift 2 ;; -h|--help) usage exit ;; -v|--version) version exit ;; -U|--ucf) do_ucf=1 shift ;; -o|--options) eval $2 shift 2 ;; --) shift break ;; *) echo "eh? $1" >&2 exit 1 ;; esac done # if they asked for all vars, or didn't ask for anything (which defaults to all) if [ "$use_all" ] || [ ! "${use_dbuser}${use_dbpass}${use_basepath}${use_dbname}${use_dbserver}${use_dbtype}${use_dbport}" ]; then use_dbuser="yes" use_dbpass="yes" use_basepath="yes" use_dbname="yes" use_dbserver="yes" use_dbport="yes" use_dbtype="yes" fi inputfile=$1 outputfile=$2 if [ ! "$inputfile" ]; then echo "you must specify an inputfile" >&2 usage >&2 exit 1 fi if [ "$outputfile" ]; then tmpout=$(mktemp -t dbconfig-generate-include.XXXXXX) if [ ! -f "$tmpout" ]; then echo "unable to create temporary file $tmpout" >&2 exit 1 fi exec > $tmpout fi if [ ! -f "$inputfile" ] || [ ! -r "$inputfile" ]; then echo "unable to read input file $inputfile" >&2 exit 1 fi if ! . $inputfile ; then echo "error processing $inputfile, check file contents" >&2 exit 1 fi # if commenting-out is enabled if [ "$use_comment" ]; then # if a comment string was not explicitly specified set a default if [ ! "$comment_string" ]; then case $format in sh|php|perl) comment_string="#" ;; cpp) comment_string="//" ;; template) echo "E: must specify a comment string for 'template' format" >&2 exit 1 ;; esac fi # now determine which things should be commented out if any [ ! "$dbc_dbuser" ] && comment_dbuser="${comment_string}" [ ! "$dbc_dbpass" ] && comment_dbpass="${comment_string}" [ ! "$dbc_basepath" ] && comment_basepath="${comment_string}" [ ! "$dbc_dbname" ] && comment_dbname="${comment_string}" [ ! "$dbc_dbserver" ] && comment_dbserver="${comment_string}" [ ! "$dbc_dbport" ] && comment_dbport="${comment_string}" [ ! "$dbc_dbtype" ] && comment_dbtype="${comment_string}" fi case $format in sh) cat << EOF ## ## database access settings in /bin/sh format ## automatically generated from $inputfile ## by $0 ## ## by default this file is managed via ucf, so you shouldn't have to ## worry about manual changes being silently discarded. *however*, ## you'll probably also want to edit the configuration file mentioned ## above too. ## EOF [ "$use_dbuser" ] && echo "${comment_dbuser}$dbuser_varname='$(sh_sq_escape "$dbc_dbuser")'" [ "$use_dbpass" ] && echo "${comment_dbpass}$dbpass_varname='$(sh_sq_escape "$dbc_dbpass")'" [ "$use_basepath" ] && echo "${comment_basepath}$basepath_varname='$(sh_sq_escape "$dbc_basepath")'" [ "$use_dbname" ] && echo "${comment_dbname}$dbname_varname='$(sh_sq_escape "$dbc_dbname")'" [ "$use_dbserver" ] && echo "${comment_dbserver}$dbserver_varname='$(sh_sq_escape "$dbc_dbserver")'" [ "$use_dbport" ] && echo "${comment_dbport}$dbport_varname='$(sh_sq_escape "$dbc_dbport")'" [ "$use_dbtype" ] && echo "${comment_dbtype}$dbtype_varname='$(sh_sq_escape "$dbc_dbtype")'" ;; php) cat << EOF <?php ## ## database access settings in php format ## automatically generated from $inputfile ## by $0 ## ## by default this file is managed via ucf, so you shouldn't have to ## worry about manual changes being silently discarded. *however*, ## you'll probably also want to edit the configuration file mentioned ## above too. ## EOF [ "$use_dbuser" ] && echo "${comment_dbuser}\$$dbuser_varname='$(php_sq_escape "$dbc_dbuser")';" [ "$use_dbpass" ] && echo "${comment_dbpass}\$$dbpass_varname='$(php_sq_escape "$dbc_dbpass")';" [ "$use_basepath" ] && echo "${comment_basepath}\$$basepath_varname='$(php_sq_escape "$dbc_basepath")';" [ "$use_dbname" ] && echo "${comment_dbname}\$$dbname_varname='$(php_sq_escape "$dbc_dbname")';" [ "$use_dbserver" ] && echo "${comment_dbserver}\$$dbserver_varname='$(php_sq_escape "$dbc_dbserver")';" [ "$use_dbport" ] && echo "${comment_dbport}\$$dbport_varname='$(php_sq_escape "$dbc_dbport")';" [ "$use_dbtype" ] && echo "${comment_dbtype}\$$dbtype_varname='$(php_sq_escape "$dbc_dbtype")';" cat << EOF EOF ;; perl) cat << EOF ## ## database access settings in perl format ## automatically generated from $inputfile ## by $0 ## ## by default this file is managed via ucf, so you shouldn't have to ## worry about manual changes being silently discarded. *however*, ## you'll probably also want to edit the configuration file mentioned ## above too. ## EOF [ "$use_dbuser" ] && echo "${comment_dbuser}our \$$dbuser_varname='$(perl_sq_escape "$dbc_dbuser")';" [ "$use_dbpass" ] && echo "${comment_dbpass}our \$$dbpass_varname='$(perl_sq_escape "$dbc_dbpass")';" [ "$use_basepath" ] && echo "${comment_basepath}our \$$basepath_varname='$(perl_sq_escape "$dbc_basepath")';" [ "$use_dbname" ] && echo "${comment_dbname}our \$$dbname_varname='$(perl_sq_escape "$dbc_dbname")';" [ "$use_dbserver" ] && echo "${comment_dbserver}our \$$dbserver_varname='$(perl_sq_escape "$dbc_dbserver")';" [ "$use_dbport" ] && echo "${comment_dbport}our \$$dbport_varname='$(perl_sq_escape "$dbc_dbport")';" [ "$use_dbtype" ] && echo "${comment_dbtype}our \$$dbtype_varname='$(perl_sq_escape "$dbc_dbtype")';" cat << EOF 1; EOF ;; cpp) cat << EOF /* * database access settings in cpp header format * why you would ever need this, who knows? :) * automatically generated from $inputfile * by $0 * * by default this file is managed via ucf, so you shouldn't have to * worry about manual changes being silently discarded. *however*, * you'll probably also want to edit the configuration file mentioned * above too. * */ #ifndef _DBCONFIG_COMMON_CONFIG_ #define _DBCONFIG_COMMON_CONFIG_ EOF [ "$use_dbuser" ] && echo " ${comment_dbuser}#define $dbuser_varname \"$dbc_dbuser\";" [ "$use_dbpass" ] && echo " ${comment_dbpass}#define $dbpass_varname \"$dbc_dbpass\";" [ "$use_basepath" ] && echo "${comment_basepath}#define $basepath_varname \"$dbc_basepath\";" [ "$use_dbname" ] && echo " ${comment_dbname}#define $dbname_varname \"$dbc_dbname\";" [ "$use_dbserver" ] && echo " ${comment_dbserver}#define $dbserver_varname \"$dbc_dbserver\";" [ "$use_dbport" ] && echo " ${comment_dbport}#define $dbport_varname \"$dbc_dbport\";" [ "$use_dbtype" ] && echo " ${comment_dbtype}#define $dbtype_varname \"$dbc_dbtype\";" cat << EOF #endif /* _DBCONFIG_COMMON_CONFIG_ */ EOF ;; template) if [ ! "$template_infile" ]; then cat << EOF >&2 error: you must specify a template file. for example: '-o template_infile=foo' EOF exit 1 elif [ ! -f "$template_infile" ]; then echo "error: template infile $template_infile does not exist" >&2 exit 1 fi sedtmp=$(mktemp -t dbconfig-generate-include.sed.XXXXXX) if [ ! -f "$sedtmp" ]; then echo "unable to create temporary file $sedtmp" >&2 exit 1 fi # we do not want _DBC_DBSERVER_ to be expanded to "" (which means "use # the best available method to connect to the local db): expand it to # "localhost" if needed if [ -z "$dbc_dbserver" ] ; then _dbc_dbserver="localhost" else _dbc_dbserver="$dbc_dbserver" fi cat << EOF > "$sedtmp" s/^\(.*\)_DBC_DBUSER_/${comment_dbuser}\1$(sed_rhs_escape "$dbc_dbuser")/g s/^\(.*\)_DBC_DBPASS_/${comment_dbpass}\1$(sed_rhs_escape "$dbc_dbpass")/g s/^\(.*\)_DBC_BASEPATH_/${comment_basepath}\1$(sed_rhs_escape "$dbc_basepath")/g s/^\(.*\)_DBC_DBNAME_/${comment_dbname}\1$(sed_rhs_escape "$dbc_dbname")/g s/^\(.*\)_DBC_DBSERVER_/${comment_dbserver}\1$(sed_rhs_escape "$_dbc_dbserver")/g s/^\(.*\)_DBC_DBPORT_/${comment_dbport}\1$(sed_rhs_escape "$dbc_dbport")/g s/^\(.*\)_DBC_DBTYPE_/${comment_dbtype}\1$(sed_rhs_escape "$dbc_dbtype")/g EOF sed -f "$sedtmp" < "$template_infile" rm -f "$sedtmp" ;; esac if [ "$outputfile" ]; then if [ -e "$outputfile" ] ; then # In order to preserve all local attributes of the # original file, copy them to the tmpout file, so that # later on they are copied back (by ucf or mv command). cp --preserve=all --attributes-only "$outputfile" "$tmpout" fi if [ "$do_ucf" ]; then ucf --debconf-ok "$tmpout" "$outputfile" >&2 rm -f "$tmpout" else mv "$tmpout" "$outputfile" fi check_permissions if [ -e "$outputfile" ] ; then [ "$owner" ] && chown $owner $outputfile [ "$perms" ] && chmod $perms $outputfile fi fi exit 0
Save
cmd:
run