File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # info: duplicate existing package
3+ #
4+ # The function allows the user to duplicate an existing
5+ # package file to facilitate easier configuration.
6+
7+ # ----------------------------------------------------------#
8+ # Variable&Function #
9+ # ----------------------------------------------------------#
10+
11+ # Argument definition
12+ package=$1
13+ new_package=$2
14+
15+ # Includes
16+ source $HESTIA /func/main.sh
17+ source $HESTIA /conf/hestia.conf
18+
19+ # ----------------------------------------------------------#
20+ # Action #
21+ # ----------------------------------------------------------#
22+
23+ if [ ! -z $1 ]; then
24+ if [ ! -f $HESTIA /data/packages/$package .pkg ]; then
25+ echo " Error: package does not exist."
26+ exit
27+ fi
28+ if [ ! -z $2 ]; then
29+ # Copy package
30+ cp -f $HESTIA /data/packages/$package .pkg $HESTIA /data/packages/$new_package .pkg
31+ else
32+ echo " Error: new package name not specified."
33+ fi
34+ else
35+ echo " Error: package name not specified."
36+ fi
37+
38+ # ----------------------------------------------------------#
39+ # Hestia #
40+ # ----------------------------------------------------------#
41+ log_event " $OK " " $ARGUMENTS "
42+
43+ exit
You can’t perform that action at this time.
0 commit comments