mirror of
				https://github.com/open5gs/open5gs.git
				synced 2025-11-03 21:43:25 +00:00 
			
		
		
		
	Rename dbconf.sh to open5gs-dbctl (#388)
This commit is contained in:
		@@ -50,11 +50,6 @@ foreach file : example_conf
 | 
				
			|||||||
            configuration : conf_data)
 | 
					            configuration : conf_data)
 | 
				
			||||||
endforeach
 | 
					endforeach
 | 
				
			||||||
 | 
					
 | 
				
			||||||
configure_file(
 | 
					 | 
				
			||||||
    input : '../misc/dbconf.sh',
 | 
					 | 
				
			||||||
    output : 'open5gs_db',
 | 
					 | 
				
			||||||
    configuration : conf_data)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
subdir('open5gs')
 | 
					subdir('open5gs')
 | 
				
			||||||
subdir('freeDiameter')
 | 
					subdir('freeDiameter')
 | 
				
			||||||
subdir('systemd')
 | 
					subdir('systemd')
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										1
									
								
								debian/open5gs-common.install
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								debian/open5gs-common.install
									
									
									
									
										vendored
									
									
								
							@@ -3,3 +3,4 @@ usr/lib/*/libfd*.so*
 | 
				
			|||||||
usr/lib/*/freeDiameter/*.fdx
 | 
					usr/lib/*/freeDiameter/*.fdx
 | 
				
			||||||
configs/freeDiameter/cacert.pem /etc/freeDiameter
 | 
					configs/freeDiameter/cacert.pem /etc/freeDiameter
 | 
				
			||||||
configs/logrotate/open5gs /etc/logrotate.d
 | 
					configs/logrotate/open5gs /etc/logrotate.d
 | 
				
			||||||
 | 
					misc/db/open5gs-dbctl
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										1
									
								
								debian/open5gs-hss.install
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								debian/open5gs-hss.install
									
									
									
									
										vendored
									
									
								
							@@ -2,4 +2,3 @@ usr/bin/open5gs-hssd
 | 
				
			|||||||
configs/freeDiameter/hss.* etc/freeDiameter
 | 
					configs/freeDiameter/hss.* etc/freeDiameter
 | 
				
			||||||
configs/open5gs/hss.yaml etc/open5gs
 | 
					configs/open5gs/hss.yaml etc/open5gs
 | 
				
			||||||
configs/systemd/open5gs-hssd.service lib/systemd/system
 | 
					configs/systemd/open5gs-hssd.service lib/systemd/system
 | 
				
			||||||
configs/open5gs_db /usr/bin
 | 
					 | 
				
			||||||
@@ -111,6 +111,7 @@ add_project_arguments(
 | 
				
			|||||||
subdir('configs')
 | 
					subdir('configs')
 | 
				
			||||||
subdir('lib')
 | 
					subdir('lib')
 | 
				
			||||||
subdir('src')
 | 
					subdir('src')
 | 
				
			||||||
 | 
					subdir('misc')
 | 
				
			||||||
# Don’t build the tests unless we can run them (either natively or in an exe wrapper)
 | 
					# Don’t build the tests unless we can run them (either natively or in an exe wrapper)
 | 
				
			||||||
build_tests = not meson.is_cross_build() or (meson.is_cross_build() and meson.has_exe_wrapper())
 | 
					build_tests = not meson.is_cross_build() or (meson.is_cross_build() and meson.has_exe_wrapper())
 | 
				
			||||||
if build_tests
 | 
					if build_tests
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,8 +2,5 @@
 | 
				
			|||||||
* Network Configuration
 | 
					* Network Configuration
 | 
				
			||||||
$ sudo ./misc/netconf.sh
 | 
					$ sudo ./misc/netconf.sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
* Add/Update/Remove A User
 | 
					 | 
				
			||||||
$ ./misc/dbconf.sh
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
* Generate Key & Cert for Diameter
 | 
					* Generate Key & Cert for Diameter
 | 
				
			||||||
$ ./misc/make_certs.sh ./freeDiameter
 | 
					$ ./misc/make_certs.sh ./freeDiameter
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										2
									
								
								misc/db/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								misc/db/README.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,2 @@
 | 
				
			|||||||
 | 
					* Add/Update/Remove A User
 | 
				
			||||||
 | 
					$ ./misc/db/open5gs-dbctl
 | 
				
			||||||
							
								
								
									
										27
									
								
								misc/db/meson.build
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								misc/db/meson.build
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,27 @@
 | 
				
			|||||||
 | 
					# Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# This file is part of Open5GS.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# This program is free software: you can redistribute it and/or modify
 | 
				
			||||||
 | 
					# it under the terms of the GNU Affero General Public License as published by
 | 
				
			||||||
 | 
					# the Free Software Foundation, either version 3 of the License, or
 | 
				
			||||||
 | 
					# (at your option) any later version.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# This program is distributed in the hope that it will be useful,
 | 
				
			||||||
 | 
					# but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
				
			||||||
 | 
					# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
				
			||||||
 | 
					# GNU General Public License for more details.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# You should have received a copy of the GNU General Public License
 | 
				
			||||||
 | 
					# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					misc_db = '''
 | 
				
			||||||
 | 
					    open5gs-dbctl
 | 
				
			||||||
 | 
					'''.split()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					foreach file : misc_db
 | 
				
			||||||
 | 
					    configure_file(
 | 
				
			||||||
 | 
					            input : file,
 | 
				
			||||||
 | 
					            output : file,
 | 
				
			||||||
 | 
					            configuration : conf_data)
 | 
				
			||||||
 | 
					endforeach
 | 
				
			||||||
@@ -3,7 +3,7 @@
 | 
				
			|||||||
version=0.9.0
 | 
					version=0.9.0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
display_help() {
 | 
					display_help() {
 | 
				
			||||||
    echo "dbconf.sh: Open5GS Database Configuration Tool ($version)"
 | 
					    echo "open5gs-dbctl: Open5GS Database Configuration Tool ($version)"
 | 
				
			||||||
    echo "COMMANDS:" >&2
 | 
					    echo "COMMANDS:" >&2
 | 
				
			||||||
    echo "   add {imsi key opc}: adds a user to the database with default values"
 | 
					    echo "   add {imsi key opc}: adds a user to the database with default values"
 | 
				
			||||||
    echo "   remove {imsi}: removes a user from the database"
 | 
					    echo "   remove {imsi}: removes a user from the database"
 | 
				
			||||||
@@ -46,13 +46,13 @@ if [ "$1" = "add" ]; then
 | 
				
			|||||||
		exit 0
 | 
							exit 0
 | 
				
			||||||
	fi
 | 
						fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	echo "dbconf.sh: incorrect number of args, format is \"dbconf.sh add imsi key opc\""
 | 
						echo "open5gs-dbctl: incorrect number of args, format is \"open5gs-dbctl add imsi key opc\""
 | 
				
			||||||
	exit 1
 | 
						exit 1
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [ "$1" = "remove" ]; then
 | 
					if [ "$1" = "remove" ]; then
 | 
				
			||||||
	if [ "$#" -ne 2 ]; then
 | 
						if [ "$#" -ne 2 ]; then
 | 
				
			||||||
		echo "dbconf.sh: incorrect number of args, format is \"dbconf.sh remove imsi\""
 | 
							echo "open5gs-dbctl: incorrect number of args, format is \"open5gs-dbctl remove imsi\""
 | 
				
			||||||
		exit 1
 | 
							exit 1
 | 
				
			||||||
	fi
 | 
						fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -63,7 +63,7 @@ fi
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
if [ "$1" = "reset" ]; then
 | 
					if [ "$1" = "reset" ]; then
 | 
				
			||||||
	if [ "$#" -ne 1 ]; then
 | 
						if [ "$#" -ne 1 ]; then
 | 
				
			||||||
		echo "dbconf.sh: incorrect number of args, format is \"dbconf.sh reset\""
 | 
							echo "open5gs-dbctl: incorrect number of args, format is \"open5gs-dbctl reset\""
 | 
				
			||||||
		exit 1
 | 
							exit 1
 | 
				
			||||||
	fi
 | 
						fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -73,7 +73,7 @@ fi
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
if [ "$1" = "static_ip" ]; then
 | 
					if [ "$1" = "static_ip" ]; then
 | 
				
			||||||
	if [ "$#" -ne 3 ]; then
 | 
						if [ "$#" -ne 3 ]; then
 | 
				
			||||||
		echo "dbconf.sh: incorrect number of args, format is \"dbconf.sh static_ip imsi ip\""
 | 
							echo "open5gs-dbctl: incorrect number of args, format is \"open5gs-dbctl static_ip imsi ip\""
 | 
				
			||||||
		exit 1
 | 
							exit 1
 | 
				
			||||||
	fi
 | 
						fi
 | 
				
			||||||
	IMSI=$2 
 | 
						IMSI=$2 
 | 
				
			||||||
@@ -85,7 +85,7 @@ fi
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
if [ "$1" = "static_ip6" ]; then
 | 
					if [ "$1" = "static_ip6" ]; then
 | 
				
			||||||
	if [ "$#" -ne 3 ]; then
 | 
						if [ "$#" -ne 3 ]; then
 | 
				
			||||||
		echo "dbconf.sh: incorrect number of args, format is \"dbconf.sh static_ip6 imsi ip\""
 | 
							echo "open5gs-dbctl: incorrect number of args, format is \"open5gs-dbctl static_ip6 imsi ip\""
 | 
				
			||||||
		exit 1
 | 
							exit 1
 | 
				
			||||||
	fi
 | 
						fi
 | 
				
			||||||
	IMSI=$2 
 | 
						IMSI=$2 
 | 
				
			||||||
@@ -97,7 +97,7 @@ fi
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
if [ "$1" = "type" ]; then
 | 
					if [ "$1" = "type" ]; then
 | 
				
			||||||
	if [ "$#" -ne 3 ]; then
 | 
						if [ "$#" -ne 3 ]; then
 | 
				
			||||||
		echo "dbconf.sh: incorrect number of args, format is \"dbconf.sh type imsi type\""
 | 
							echo "open5gs-dbctl: incorrect number of args, format is \"open5gs-dbctl type imsi type\""
 | 
				
			||||||
		exit 1
 | 
							exit 1
 | 
				
			||||||
	fi
 | 
						fi
 | 
				
			||||||
	IMSI=$2 
 | 
						IMSI=$2 
 | 
				
			||||||
							
								
								
									
										31
									
								
								misc/meson.build
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								misc/meson.build
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,31 @@
 | 
				
			|||||||
 | 
					# Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# This file is part of Open5GS.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# This program is free software: you can redistribute it and/or modify
 | 
				
			||||||
 | 
					# it under the terms of the GNU Affero General Public License as published by
 | 
				
			||||||
 | 
					# the Free Software Foundation, either version 3 of the License, or
 | 
				
			||||||
 | 
					# (at your option) any later version.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# This program is distributed in the hope that it will be useful,
 | 
				
			||||||
 | 
					# but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
				
			||||||
 | 
					# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
				
			||||||
 | 
					# GNU General Public License for more details.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# You should have received a copy of the GNU General Public License
 | 
				
			||||||
 | 
					# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					conf_data = configuration_data()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					conf_data.set('bindir', bindir)
 | 
				
			||||||
 | 
					conf_data.set('sysconfdir', sysconfdir)
 | 
				
			||||||
 | 
					conf_data.set('libdir', libdir)
 | 
				
			||||||
 | 
					conf_data.set('localstatedir', localstatedir)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if host_system == 'linux'
 | 
				
			||||||
 | 
					    conf_data.set('loopback_devname', 'lo')
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
					    conf_data.set('loopback_devname', 'lo0')
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					subdir('db')
 | 
				
			||||||
		Reference in New Issue
	
	Block a user