Submit
Path:
~
/
/
opt
/
psa
/
admin
/
sbin
/
modules
/
ntp-timesync
/
File Content:
package-mng.sh
#!/usr/bin/env bash ### Copyright 1999-2024. WebPros International GmbH. All rights reserved. PACKAGE_MANAGER="" present() { local package="$1" case "$PACKAGE_MANAGER" in apt) if apt show "$package" >/dev/null 2>&1; then echo "true" return fi ;; dnf) if dnf list "$package" >/dev/null 2>&1; then echo "true" return fi ;; yum) if yum list "$package" >/dev/null 2>&1; then echo "true" return fi ;; esac echo "false" } known_unit() { # CentOS 7.0 and 7.1 probably don't have this feature local service="$1" if systemctl cat "${service}.service"; then echo "true" return fi echo "false" } find_package_manager() { if command -v apt >/dev/null 2>&1; then PACKAGE_MANAGER="apt" return 0 fi if command -v dnf >/dev/null 2>&1; then PACKAGE_MANAGER="dnf" return 0 fi if command -v yum >/dev/null 2>&1; then PACKAGE_MANAGER="yum" return 0 fi return 1 } main() { if ! find_package_manager; then echo "Unknown package manager" >&2 exit 1 fi case "$1" in is-present) present "${2:?'Package name must be specified as second parameter'}" ;; is-known-unit) known_unit "${2:?'Service name must be specified as second parameter'}" ;; *) echo "Unknown command ${1}" >&2 exit 1 esac } main "$@"
Edit
Rename
Chmod
Delete
FILE
FOLDER
INFO
Name
Size
Permission
Action
chrony-mng.sh
931 bytes
0755
dbus-send.py
610 bytes
0755
ntp-mng.sh
806 bytes
0755
package-mng.sh
1652 bytes
0755
time-mng.sh
5638 bytes
0755
N4ST4R_ID | Naxtarrr