fix installation
This commit is contained in:
@@ -144,10 +144,10 @@ def install(name):
|
|||||||
if _check_openrc():
|
if _check_openrc():
|
||||||
_install_files(_openrc_files(pkg_dir, name))
|
_install_files(_openrc_files(pkg_dir, name))
|
||||||
|
|
||||||
if not _create_dir(f"/etc/{name}"):
|
for d in [f"/etc/{name}", f"/etc/{name}/templates"]:
|
||||||
|
if not _create_dir(d):
|
||||||
logging.error(" => unable to create config dir, giving up ...")
|
logging.error(" => unable to create config dir, giving up ...")
|
||||||
sys.exit(3)
|
sys.exit(3)
|
||||||
|
|
||||||
_install_files(_config_files(pkg_dir, name))
|
_install_files(_config_files(pkg_dir, name))
|
||||||
|
|
||||||
logging.info(f"{name} successfully installed")
|
logging.info(f"{name} successfully installed")
|
||||||
@@ -163,6 +163,7 @@ def uninstall(name):
|
|||||||
_uninstall_files(_openrc_files(pkg_dir, name))
|
_uninstall_files(_openrc_files(pkg_dir, name))
|
||||||
_uninstall_files(_config_files(pkg_dir, name))
|
_uninstall_files(_config_files(pkg_dir, name))
|
||||||
|
|
||||||
|
_delete_dir(f"/etc/{name}/templates")
|
||||||
_delete_dir(f"/etc/{name}")
|
_delete_dir(f"/etc/{name}")
|
||||||
|
|
||||||
logging.info(f"{name} successfully uninstalled")
|
logging.info(f"{name} successfully uninstalled")
|
||||||
|
|||||||
@@ -74,13 +74,6 @@ def main():
|
|||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
name = "pyquarantine"
|
|
||||||
if args.install:
|
|
||||||
sys.exit(install(name))
|
|
||||||
|
|
||||||
if args.uninstall:
|
|
||||||
sys.exit(uninstall(name))
|
|
||||||
|
|
||||||
root_logger = logging.getLogger()
|
root_logger = logging.getLogger()
|
||||||
root_logger.setLevel(logging.DEBUG)
|
root_logger.setLevel(logging.DEBUG)
|
||||||
|
|
||||||
@@ -95,6 +88,13 @@ def main():
|
|||||||
if not args.debug:
|
if not args.debug:
|
||||||
logger.setLevel(logging.INFO)
|
logger.setLevel(logging.INFO)
|
||||||
|
|
||||||
|
name = "pyquarantine"
|
||||||
|
if args.install:
|
||||||
|
sys.exit(install(name))
|
||||||
|
|
||||||
|
if args.uninstall:
|
||||||
|
sys.exit(uninstall(name))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
logger.debug("read milter configuration")
|
logger.debug("read milter configuration")
|
||||||
cfg = get_milter_config(args.config)
|
cfg = get_milter_config(args.config)
|
||||||
|
|||||||
Reference in New Issue
Block a user