Changeset 23
- Timestamp:
- May 26, 2014, 1:53:39 PM (11 years ago)
- Location:
- scripts
- Files:
-
- 1 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
scripts/etc/7dtd.conf
r18 r23 1 1 #!/bin/sh 2 # Version 43 2 4 3 # Root directory where steamcmd should be placed -
scripts/etc/init.d/7dtd.sh
r17 r23 1 1 #!/bin/sh 2 # Version 43 2 4 3 ### BEGIN INIT INFO -
scripts/usr/local/bin/7dtd.sh
r17 r23 1 1 #!/bin/bash 2 # Version 43 2 4 3 . /usr/local/lib/7dtd/common.sh -
scripts/usr/local/lib/7dtd/commands/backup.sh
r20 r23 1 1 #!/bin/bash 2 # Version 53 2 4 3 # Backups game data files. -
scripts/usr/local/lib/7dtd/commands/instances.sh
r20 r23 1 1 #!/bin/bash 2 # Version 53 2 4 3 … … 52 51 esac 53 52 done 53 echo 54 54 fi 55 55 configEditAll … … 75 75 return 76 76 fi 77 77 78 78 if [ $(isRunning "$1") -eq 0 ]; then 79 79 INSTANCE=$1 80 80 loadCurrentConfigValues "$1" 81 configEditAll 82 echo 83 configSetAutoParameters "$INSTANCE" 84 echo 85 echo "Saving" 86 saveCurrentConfigValues "$1" 87 echo "Done" 81 82 while : ; do 83 echo "What section of the config do you want to edit?" 84 local i=0 85 local sects=() 86 for S in $(listConfigEditFuncs); do 87 (( i++ )) 88 sects[$i]=$S 89 printf " %2d: %s\n" $i "$S" 90 done 91 echo 92 echo " W: Save and exit" 93 echo " Q: Exit WITHOUT saving" 94 95 local SEC 96 while : ; do 97 read -p "Section number: " SEC 98 SEC=$(lowercase $SEC) 99 if [ $(isANumber $SEC) -eq 1 ]; then 100 if [ $SEC -ge 1 -a $SEC -le $i ]; then 101 break 102 fi 103 else 104 if [ "$SEC" = "q" -o "$SEC" = "w" ]; then 105 break 106 fi 107 fi 108 echo "Not a valid section number!" 109 done 110 echo 111 112 case "$SEC" in 113 q) 114 echo "Not saving" 115 break 116 ;; 117 w) 118 configSetAutoParameters "$INSTANCE" 119 echo "Saving" 120 saveCurrentConfigValues "$1" 121 echo "Done" 122 break 123 ;; 124 *) 125 configEdit${sects[$SEC]} 126 echo 127 esac 128 done 88 129 else 89 130 echo "Instance $1 is currently running. Please stop it first." -
scripts/usr/local/lib/7dtd/commands/start.sh
r20 r23 1 1 #!/bin/bash 2 # Version 53 2 4 3 # Tries to start the 7dtd instance. -
scripts/usr/local/lib/7dtd/commands/status.sh
r20 r23 1 1 #!/bin/bash 2 # Version 53 2 4 3 # Print status of given instance. -
scripts/usr/local/lib/7dtd/commands/stop.sh
r20 r23 1 1 #!/bin/bash 2 # Version 53 2 4 3 # Tries to stop the 7dtd instance given as first parameter. -
scripts/usr/local/lib/7dtd/commands/updateengine.sh
r21 r23 1 1 #!/bin/bash 2 # Version 53 2 4 3 # Tries to start the 7dtd instance. -
scripts/usr/local/lib/7dtd/common.sh
r20 r23 1 1 #!/bin/bash 2 # Version 53 2 4 3 # Provides common functions for 7dtd-scripts. Not intended to be run directly. -
scripts/usr/local/lib/7dtd/help.sh
r20 r23 1 1 #!/bin/bash 2 # Version 53 2 4 3 genericHelp() { -
scripts/usr/local/lib/7dtd/monitor-log.sh
r20 r23 1 1 #!/bin/bash 2 # Version 53 2 4 3 . /usr/local/lib/7dtd/common.sh -
scripts/usr/local/lib/7dtd/playerlog.sh
r20 r23 1 1 #!/bin/bash 2 # Version 53 2 4 3 timestamp() { -
scripts/usr/local/lib/7dtd/serverconfig.sh
r20 r23 1 1 #!/bin/bash 2 # Version 53 2 4 3 # Provides functions to query and validate values for serverconfig.xml 4 5 ################################# 6 ## Definition of options 5 7 6 8 serverconfig_ServerPort_QueryName() { … … 684 686 685 687 686 ############ 688 ################################# 689 ## Edit option functions 690 691 configEditServer() { 692 local CV 693 694 echo "Server" 695 echo "--------------------------------" 696 for CV in \ 697 ServerName ServerPassword ServerIsPublic ServerPort ServerMaxPlayerCount \ 698 DisableNAT \ 699 ; do 700 configQueryValue $CV 701 echo 702 done 703 echo 704 } 705 706 configEditRemoteControl() { 707 local CV 708 709 echo "Remote control" 710 echo "--------------------------------" 711 for CV in \ 712 ControlPanelEnabled ControlPanelPort ControlPanelPassword \ 713 TelnetPort TelnetPassword \ 714 ; do 715 if [ "$CV" = "TelnetPort" ]; then 716 echo 717 echo "NOTE: Telnet will always be enabled for management purposes!" 718 echo "Make sure you block external access to this port!" 719 echo 720 fi 721 configQueryValue $CV 722 echo 723 done 724 echo 725 } 726 727 configEditGameType() { 728 local CV 729 730 echo "Game type" 731 echo "--------------------------------" 732 for CV in \ 733 GameName GameWorld GameMode \ 734 ; do 735 configQueryValue $CV 736 echo 737 done 738 echo 739 } 740 741 configEditGameTypeSpecific() { 742 local CV 743 744 echo "Options for specific game types" 745 echo "--------------------------------" 746 for CV in \ 747 DayCount FragLimit MatchLength RebuildMap \ 748 ; do 749 configQueryValue $CV 750 echo 751 done 752 echo 753 } 754 755 configEditGeneric() { 756 local CV 757 758 echo "Generic options" 759 echo "--------------------------------" 760 for CV in \ 761 ShowAllPlayersOnMap FriendlyFire BuildCreate \ 762 BlockDurabilityModifier \ 763 ; do 764 configQueryValue $CV 765 echo 766 done 767 echo 768 } 769 770 configEditDropLoot() { 771 local CV 772 773 echo "Drop and Loot" 774 echo "--------------------------------" 775 for CV in \ 776 DropOnDeath DropOnQuit \ 777 LootAbundance LootRespawnDays AirDropFrequency \ 778 ; do 779 configQueryValue $CV 780 echo 781 done 782 echo 783 } 784 785 configEditTimes() { 786 local CV 787 788 echo "Times / Durations" 789 echo "--------------------------------" 790 for CV in \ 791 CraftTimer LootTimer \ 792 DayNightLength NightPercentage \ 793 ; do 794 configQueryValue $CV 795 echo 796 done 797 echo 798 } 799 800 configEditDifficulty() { 801 local CV 802 803 echo "Difficulty" 804 echo "--------------------------------" 805 for CV in \ 806 GameDifficulty ZombiesRun \ 807 PlayerDamageGiven PlayerDamageRecieved EnemySenseMemory EnemySpawnMode EnemyDifficulty \ 808 ; do 809 configQueryValue $CV 810 echo 811 done 812 echo 813 } 814 815 configEditLandClaim() { 816 local CV 817 818 echo "Land claim options" 819 echo "--------------------------------" 820 for CV in \ 821 LandClaimSize LandClaimDeadZone LandClaimExpiryTime LandClaimDecayMode \ 822 LandClaimOnlineDurabilityModifier LandClaimOfflineDurabilityModifier \ 823 ; do 824 configQueryValue $CV 825 echo 826 done 827 echo 828 } 829 830 configEditAll() { 831 configEditServer 832 configEditRemoteControl 833 configEditGameType 834 configEditGameTypeSpecific 835 configEditGeneric 836 configEditDropLoot 837 configEditTimes 838 configEditDifficulty 839 configEditLandClaim 840 } 841 842 843 844 845 846 ################################# 847 ## Generic worker functions 848 849 850 # List all defined config editing parts 851 # Returns: 852 # List of config funcs 853 listConfigEditFuncs() { 854 local CV 855 for CV in $(declare -F | cut -d\ -f3 | grep "^configEdit.*$"); do 856 CV=${CV#configEdit} 857 printf "%s " "$CV" 858 done 859 } 860 861 862 # List all defined config options 863 # Returns: 864 # List of defined config options 687 865 listConfigValues() { 688 866 local CV … … 695 873 696 874 697 # 1: Option name 698 # 2: Value 875 # Validate the given value for the given option 876 # Params: 877 # 1: Option name 878 # 2: Value 879 # Returns: 880 # 0/1: invalid/valid 699 881 isValidOptionValue() { 700 882 local TYPE=$(serverconfig_$1_Type) … … 747 929 } 748 930 749 # 1: Option name 750 # 2: Target variable 931 # Query for the value of a single config option 932 # Will be stored in $configCurrent_$1 933 # Params: 934 # 1: Option name 751 935 configQueryValue() { 752 936 local TYPE=$(serverconfig_$1_Type) … … 824 1008 } 825 1009 1010 # Set parameters for current instance that have forced values: 1011 # - TelnetEnabled must be set so that management scripts can work 1012 # - AdminFileName is made to point to the local instance admins.xml 1013 # - SaveGameFolder is made to point to the instance folder 1014 # Params: 826 1015 # 1: Instance name 827 1016 configSetAutoParameters() { … … 831 1020 } 832 1021 833 configEditAll() { 834 local CV 835 for CV in \ 836 ServerName ServerPort ServerIsPublic ServerPassword ServerMaxPlayerCount \ 837 DisableNAT \ 838 ControlPanelEnabled ControlPanelPort ControlPanelPassword \ 839 TelnetPort TelnetPassword \ 840 GameWorld GameName GameMode \ 841 ShowAllPlayersOnMap FriendlyFire BuildCreate \ 842 DayCount FragLimit MatchLength RebuildMap \ 843 DropOnDeath DropOnQuit \ 844 LootAbundance LootRespawnDays AirDropFrequency \ 845 CraftTimer LootTimer \ 846 DayNightLength NightPercentage \ 847 GameDifficulty ZombiesRun \ 848 PlayerDamageGiven PlayerDamageRecieved EnemySenseMemory EnemySpawnMode EnemyDifficulty \ 849 BlockDurabilityModifier \ 850 LandClaimSize LandClaimDeadZone LandClaimExpiryTime LandClaimDecayMode \ 851 LandClaimOnlineDurabilityModifier LandClaimOfflineDurabilityModifier \ 852 ; do 853 configQueryValue $CV 854 echo 855 done 856 } 857 1022 1023 # Print currently defined config values 858 1024 printCurrentConfig() { 859 1025 local CV … … 864 1030 } 865 1031 1032 # Query for an instance name (will be saved in $INSTANCE) 866 1033 readInstanceName() { 867 1034 until [ $(isValidInstanceName "$INSTANCE") -eq 1 ]; do … … 877 1044 } 878 1045 1046 # Undefine the current config values 879 1047 unsetAllConfigValues() { 880 1048 local CV … … 885 1053 } 886 1054 1055 # Load all config values from the config.xml of the given instance 1056 # Params: 887 1057 # 1: Instance name 888 1058 loadCurrentConfigValues() { … … 899 1069 } 900 1070 1071 # Save all config values to the config.xml of the given instance 1072 # Params: 901 1073 # 1: Instance name 902 1074 saveCurrentConfigValues() { … … 923 1095 } 924 1096 1097 # Check if the config template exists 1098 # Returns: 1099 # 0/1: no/yes 925 1100 configTemplateExists() { 926 1101 if [ -f $SDTD_BASE/templates/config.xml ]; then
Note:
See TracChangeset
for help on using the changeset viewer.