-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsrvctl.sh
executable file
·61 lines (47 loc) · 1.28 KB
/
srvctl.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
#
# Server Controll script for Fedora with LXC containers
#
# D250 Laboratories / D250.hu
# Author: István király
#
## Source URL
## URL="https://raw.githubusercontent.com/LaKing/Fedora-scripts/master/srvctl"
if [ ! -d /usr/share/srvctl ]
then
install_bin=$(realpath "$BASH_SOURCE")
install_dir=${install_bin:0:-10}
else
install_bin=/usr/share/srvctl/srvctl.sh
install_dir=/usr/share/srvctl
fi
install_ver=$(cat $install_dir/version)
source $install_dir/init.sh
source $install_dir/authorize.sh
if [ "$CMD" == "man" ] || [ "$CMD" == "help" ] || [ "$CMD" == "-help" ] || [ "$CMD" == "--help" ]
then
source $install_dir/srvctl-man.sh
exit
fi
## init libs
source $install_dir/libs/commonlib.sh
load_libs
#echo "Libs loaded"
logs "[$(whoami)@$(hostname) $(pwd)]# $0 $*"
#msg "$(head $0 -n 3 | grep version)"
SUCC=""
## hint provides a sort of help functionality - initialize empty
function hint {
echo 0 >> /dev/null
}
## this is used at the end of command-blocks, to confirm command success or failure.
function ok {
SUCC=" "
}
## if onVE C - the container name - should be the hostname
C=$HOSTNAME
#load the commands - and execute them
load_commands
#echo "Commands loaded"
source $install_dir/finish.sh