Changeset 99510 in vbox for trunk/src/VBox/Additions/linux/installer
- Timestamp:
- Apr 21, 2023 5:29:06 PM (22 months ago)
- svn:sync-xref-src-repo-rev:
- 157007
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/installer/vboxadd.sh
r99508 r99510 108 108 } 109 109 110 # When script is running as non-root, it does not have access to log 111 # files in /var. In this case, lets print error message to stdout and 112 # exit with bad status. 113 early_fail() 114 { 115 echo "$1" >&2 116 exit 1 117 } 118 110 119 fail() 111 120 { … … 215 224 cat "$version_string_path" 216 225 else 217 echo " UNKNOWN"226 echo "unknown" 218 227 fi 219 228 } … … 944 953 } 945 954 955 check_root() 956 { 957 # Check if script is running with root privileges and exit if it does not. 958 [ `id -u` -eq 0 ] || early_fail "root privileges are required" 959 } 960 946 961 # Check if process with this PID is running. 947 962 check_pid() … … 1048 1063 { 1049 1064 begin "reloading kernel modules and services" 1050 1051 # Check if script was started with root privileges.1052 [ `id -u` -eq 0 ] || fail "root privileges are required"1053 1065 1054 1066 # Stop VBoxService if running. … … 1146 1158 # system so that we can see later if any were added. 1147 1159 start) 1160 check_root 1148 1161 start 1149 1162 ;; … … 1152 1165 # this fast enough at start time if we discover we do not want to use them. 1153 1166 stop) 1167 check_root 1154 1168 stop 1155 1169 ;; 1156 1170 restart) 1171 check_root 1157 1172 restart 1158 1173 ;; 1159 1174 # Tries to reload kernel modules and restart user processes. 1160 1175 reload) 1176 check_root 1161 1177 reload 1162 1178 ;; … … 1165 1181 # current kernel. 1166 1182 setup) 1183 check_root 1167 1184 cleanup && start 1168 1185 ;; 1169 1186 # Builds kernel modules for the specified kernels if they are not already built. 1170 1187 quicksetup) 1188 check_root 1171 1189 if test x"$2" = xall; then 1172 1190 for topi in /lib/modules/*; do … … 1184 1202 # including all kernel modules. 1185 1203 cleanup) 1204 check_root 1186 1205 cleanup 1187 1206 ;; … … 1190 1209 ;; 1191 1210 status-kernel) 1211 check_root 1192 1212 check_status_kernel && info "Kernel modules are loaded" 1193 1213 ;; 1194 1214 status-user) 1215 check_root 1195 1216 check_status_user 1196 1217 if [ $? -eq 0 ]; then
Note:
See TracChangeset
for help on using the changeset viewer.