forked from fviatool/host
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmonitor.sh
46 lines (39 loc) · 1.44 KB
/
monitor.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
#!/bin/bash
#####################################################################
####### Monitor Script #########
#####################################################################
### Global Variables
OS=$(uname -s)
DISTRIB=$(awk '{print $1}' /etc/centos-release)
SQUID_VERSION=4.8
CONFIG_FILE="/opt/squid/config.cfg"
BASEDIR="/opt/squid"
CONFIGDIR="/etc/squid"
USERMASTER="/etc/squid/squid.passwd"
MYSQLDB="squiddb"
MYSQLUSER="squid"
MYSQL_PWD="root@2019"
export MYSQL_PWD
CDATE=$(date +%F)
CTIME=$(date +%T)
# Function to generate random username
generate_username() {
# Modify this function to generate a random username as per your requirements
# For example, you can use random strings or combine predefined words
# Replace this with your own logic
echo "user$(date +%s | sha256sum | base64 | head -c 8 ; echo)"
}
# Function to generate random password
generate_password() {
# Modify this function to generate a random password as per your requirements
# For example, you can use random strings, numbers, and special characters
# Replace this with your own logic
echo "$(date +%s | sha256sum | base64 | head -c 12 ; echo)"
}
# Generate random username and password
username=$(generate_username)
password=$(generate_password)
# Use the generated username and password as needed in your script
echo "username: $username"
echo "password: $password"
# Proceed with the rest of your script